Skip to content

Repaints must re-arrange dirty queue to realize painters algorithm #27

@stoffera

Description

@stoffera

If a view is already scheduled to be repainted, any additional calls to scheduleRepaint() will be ignored. This causes this code sequence behave unexpected:

textlbl.setText("My new text");
bgView.scheduleRepaint();
textLbl.scheduleRepaint();

The first setText command will insert the TextLabelView into the dirty queue to schedule repaint in the future. When scheduleRepaint is called on the background view (bgView), this view is appended to the queue. The last call to textLbl have no effect, since the display system ignores it.

Solution

scheduleRepaint should not ignore the request if the view already exists in the dirty queue. It should instead move the view to the end of the queue. This will ensure the view painted as the last, thereby rendering it visible.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions