Skip to content

Commit

Permalink
use component offset
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Oct 28, 2024
1 parent 35c0a1a commit f5004b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions haxe/ui/components/ColorPicker.hx
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ private class HSVColorPickerImpl extends ColorPickerImpl {
Screen.instance.registerEvent(MouseEvent.MOUSE_MOVE, onScreenMouseMove);
Screen.instance.registerEvent(MouseEvent.MOUSE_UP, onScreenMouseUp);

applyHSVFromCoord(e.screenX - saturationValueGraph.screenLeft, e.screenY - saturationValueGraph.screenTop);
applyHSVFromCoord(e.screenX - (saturationValueGraph.screenLeft + getComponentOffset().x), e.screenY - (saturationValueGraph.screenTop + getComponentOffset().y));
}

private var _trackingHue:Bool = false;
Expand All @@ -594,14 +594,14 @@ private class HSVColorPickerImpl extends ColorPickerImpl {
Screen.instance.registerEvent(MouseEvent.MOUSE_MOVE, onScreenMouseMove);
Screen.instance.registerEvent(MouseEvent.MOUSE_UP, onScreenMouseUp);

applyHueFromCoord(e.screenX - hueGraph.screenLeft, e.screenY - hueGraph.screenTop);
applyHueFromCoord(e.screenX - (hueGraph.screenLeft + getComponentOffset().x), e.screenY - (hueGraph.screenTop + getComponentOffset().y));
}

private function onScreenMouseMove(e:MouseEvent) {
if (_trackingSaturationValue) {
applyHSVFromCoord(e.screenX - saturationValueGraph.screenLeft, e.screenY - saturationValueGraph.screenTop);
applyHSVFromCoord(e.screenX - (saturationValueGraph.screenLeft + getComponentOffset().x), e.screenY - (saturationValueGraph.screenTop + getComponentOffset().y));
} else if (_trackingHue) {
applyHueFromCoord(e.screenX - hueGraph.screenLeft, e.screenY - hueGraph.screenTop);
applyHueFromCoord(e.screenX - (hueGraph.screenLeft + getComponentOffset().x), e.screenY - (hueGraph.screenTop + getComponentOffset().y));
}
}

Expand Down
2 changes: 1 addition & 1 deletion haxe/ui/components/DropDown.hx
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ class DropDownEvents extends ButtonEvents {
_wrapper.removeClass("popup-from-bottom");
if (_dropdown.dropdownVerticalPosition == "bottom" || _wrapper.screenTop + _wrapper.actualComponentHeight > Screen.instance.actualHeight) {
_wrapper.addClass("popup-from-bottom");
_wrapper.top = (_dropdown.screenTop - _wrapper.actualComponentHeight) + Toolkit.scaleY;
_wrapper.top = (_dropdown.screenTop + componentOffset.y - _wrapper.actualComponentHeight) + Toolkit.scaleY;
_wrapper.syncComponentValidation();
_wrapper.validateNow();
var marginLeft = 0.0;
Expand Down

0 comments on commit f5004b9

Please sign in to comment.