Skip to content

Commit

Permalink
Merge pull request #396 from JFormDesigner/padding-hit-fix
Browse files Browse the repository at this point in the history
Fix computing hit character if padding is set on the paragraph-text
  • Loading branch information
TomasMikula authored Dec 26, 2016
2 parents 7487403 + e8b626c commit e8f4107
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ public CharacterHit hit(Point2D pos) {
public CharacterHit hit(double x, double y) {
Point2D onScreen = this.localToScreen(x, y);
Point2D inText = text.screenToLocal(onScreen);
return text.hit(inText.getX(), inText.getY());
Insets textInsets = text.getInsets();
return text.hit(inText.getX() - textInsets.getLeft(), inText.getY() - textInsets.getTop());
}

public CaretOffsetX getCaretOffsetX() {
Expand Down

0 comments on commit e8f4107

Please sign in to comment.