Skip to content

Commit

Permalink
Fix support for getter/setter reflection on some targets
Browse files Browse the repository at this point in the history
  • Loading branch information
jgranick committed Apr 10, 2017
1 parent f22ac34 commit f0555bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions com/eclecticdesignstudio/dialog/Dialog.hx
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ class Dialog extends Sprite {

private function constructButton (name:String, eventType:String):Void {

if (Reflect.hasField (Display, name)) {
if (Reflect.hasField (Display, name) || Reflect.hasField (Display, "get_" + name)) {

ButtonHelper.makeButton (Reflect.field (Display, name), ButtonHelper.handleEvent (sendEvent, [ eventType ]), true);
ButtonHelper.makeButton (Reflect.getProperty (Display, name), ButtonHelper.handleEvent (sendEvent, [ eventType ]), true);

}

Expand Down
4 changes: 2 additions & 2 deletions com/eclecticdesignstudio/ui/Scrollbar.hx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class Scrollbar {
if (property != null) {

var properties:Dynamic = { };
Reflect.setField (properties, property, (maximum - minimum) * percentage + minimum);
Reflect.setProperty (properties, property, (maximum - minimum) * percentage + minimum);

Actuate.tween (target, time, properties);

Expand Down Expand Up @@ -234,7 +234,7 @@ class Scrollbar {

if (target != null && property != null) {

currentPosition = Utils.constrain ((Reflect.field (target, property) - minimum) / (maximum - minimum), 0, 1);
currentPosition = Utils.constrain ((Reflect.getProperty (target, property) - minimum) / (maximum - minimum), 0, 1);
scroll (currentPosition, time);

}
Expand Down

0 comments on commit f0555bb

Please sign in to comment.