From 86b9584010432b0372d3c0dedd5147f39860f2d8 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 15 May 2022 04:22:01 -0500 Subject: [PATCH] Add callback handling to MexUI Image control --- third-party/mexui/Core/Control/Image.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/third-party/mexui/Core/Control/Image.js b/third-party/mexui/Core/Control/Image.js index d629e341..495ac2ad 100644 --- a/third-party/mexui/Core/Control/Image.js +++ b/third-party/mexui/Core/Control/Image.js @@ -17,4 +17,14 @@ mexui.Control.Image.prototype.render = function() if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); +}; + +// input +mexui.Control.Image.prototype.onMouseDown = function(e) +{ + if(e.button == 0 && this.isCursorOverControl()) + { + e.used = true; + this.checkToCallCallback(); + } }; \ No newline at end of file