Improving the drawing performances

Registered by arno_b

Thanks to several tests, it seems that shapes that are not in the scene view are drawn.
In this case, improving the drawing performances is simple: each drawing method must have a parameter 'scene' and must be drawn only if they are contained into this scene. The scene represents the current visible rectangle and can be easily got from the scollpane:
    scene = scrollpane.getViewport().getViewRect();
    scene.height /= zoom;
    scene.width /= zoom;
    scene.x /= zoom;
    scene.y /= zoom;

A check in the drawing operations can be:
  if(position.getX()<visibleScene.width+visibleScene.x && position.getY()<visibleScene.height+visibleScene.y)
   g.drawString(text, (int)position.getX(), (int)position.getY());

Blueprint information

Status:
Complete
Approver:
None
Priority:
High
Drafter:
None
Direction:
Approved
Assignee:
arno_b
Definition:
Approved
Series goal:
Accepted for 3.x
Implementation:
Implemented
Milestone target:
milestone icon 3.1
Started by
arno_b
Completed by
arno_b

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.