Skip to content

Commit

Permalink
use padding in text input
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Oct 7, 2024
1 parent 3da709c commit 6986d41
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions haxe/ui/backend/flixel/textinputs/FlxTextInput.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class FlxTextInput extends TextBase {
public static var USE_ON_ADDED:Bool = false;
public static var USE_ON_REMOVED:Bool = false;

private var PADDING_X:Int = 4;
private var PADDING_Y:Int = 0;
private static inline var PADDING_X:Int = 4;
private static inline var PADDING_Y:Int = 2;

private var tf:flixel.addons.text.FlxTextInput;

Expand Down Expand Up @@ -198,7 +198,7 @@ class FlxTextInput extends TextBase {

private override function validatePosition() {
_left = Math.round(_left * Toolkit.scaleX);
_top = Math.round(_top * Toolkit.scaleY);
_top = Math.round(_top * Toolkit.scaleY) + (PADDING_Y / 2);
}

private override function validateDisplay() {
Expand All @@ -211,8 +211,8 @@ class FlxTextInput extends TextBase {
tf.fieldWidth = tf.width;
}

if (tf.height != _height * Toolkit.scaleY) {
tf.height = _height * Toolkit.scaleY;
if (tf.height != (_height + PADDING_Y) * Toolkit.scaleY) {
tf.height = (_height + PADDING_Y) * Toolkit.scaleY;
tf.fieldHeight = tf.height;
}
}
Expand Down

0 comments on commit 6986d41

Please sign in to comment.