Skip to content

Commit

Permalink
TextArea selection fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Sep 29, 2024
1 parent f2ffd0e commit 85daacb
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions arc-core/src/arc/scene/ui/TextArea.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package arc.scene.ui;

import arc.Core;
import arc.struct.IntSeq;
import arc.graphics.g2d.Font;
import arc.graphics.g2d.GlyphLayout;
import arc.input.KeyCode;
import arc.scene.Scene;
import arc.scene.event.InputEvent;
import arc.scene.event.InputListener;
import arc.scene.style.Drawable;
import arc.util.Align;
import arc.util.pooling.Pools;
import arc.*;
import arc.graphics.g2d.*;
import arc.input.*;
import arc.math.*;
import arc.scene.*;
import arc.scene.event.*;
import arc.scene.style.*;
import arc.struct.*;
import arc.util.*;
import arc.util.pooling.*;

/** A multiple-line text input field, entirely based on {@link TextField} */
public class TextArea extends TextField{
Expand Down Expand Up @@ -358,6 +357,7 @@ protected void setCursorPosition(float x, float y){

cursorLine = (int)Math.floor((height - y) / font.getLineHeight()) + firstLineShowing;
cursorLine = Math.max(0, Math.min(cursorLine, getLines() - 1));
cursorLine = Mathf.clamp(cursorLine, firstLineShowing, firstLineShowing + linesShowing - 1);

super.setCursorPosition(x, y);
updateCurrentLine();
Expand Down

0 comments on commit 85daacb

Please sign in to comment.