Scrollpane location in changed when element is redrawn

Bug #1828782 reported by Kenneth Yrke Jørgensen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
TAPAAL
Fix Released
Critical
Kenneth Yrke Jørgensen
Dev
Fix Released
Critical
Kenneth Yrke Jørgensen

Bug Description

-Draw a net with a horisontal scroll pane, (or zoom on a net, or make a small window).
-Select any location on the scroll pane.
-Click any location on the drawing surface (or any other option that will trigger a redraw)

Scrollpane will now jump to a "random" location.

Related branches

Revision history for this message
Kenneth Yrke Jørgensen (yrke) wrote :

The issue is found when any element with an pnLable is redraw/updated.

The update function will call setName/setText on the lable.
This function will call setSize()

setSize invalidates the element and redraws it.

Standard behavior for a JTextComponent is to move any parent JScroll list to the location of the label updated (See https://docs.oracle.com/javase/7/docs/api/javax/swing/text/JTextComponent.html)

Set
  DefaultCaret c = new DefaultCaret();
  c.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
  setCaret(c);
to overwrite this behavior.

Changed in tapaal:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Kenneth Yrke Jørgensen (yrke)
Changed in tapaal:
status: Confirmed → Fix Released
status: Fix Released → Fix Committed
Jiri Srba (srba)
Changed in tapaal:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.