Skip to content

Commit

Permalink
setLocation(): round coords instead of truncating.
Browse files Browse the repository at this point in the history
This avoids visual artifacts on devices with non-integer
scaling factors.
  • Loading branch information
guillerodriguez committed Sep 11, 2018
1 parent 68c77d5 commit 47d4147
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/tripleplay/ui/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ protected IDimension preferredSize (float hintX, float hintY) {
* Configures the location of this element, relative to its parent.
*/
protected void setLocation (float x, float y) {
layer.setTranslation(MathUtil.ifloor(x), MathUtil.ifloor(y));
layer.setTranslation(MathUtil.round(x), MathUtil.round(y));
}

/**
Expand Down

0 comments on commit 47d4147

Please sign in to comment.