Most components' bounding boxes are not correctly calculated before first "draw" call

Bug #607537 reported by Arseniy Alekseyev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Workcraft
Confirmed
Low
Unassigned

Bug Description

Steps to reproduce:
* Import large enough STG.
* Open it in editor. It should be laid out with dot.
Some components will be overlapping.
* Select Layout -> "Layout using dot" from main menu.
The overlaps will be eliminated.

The internal cause is that the calculation of text bounding boxes requires creation of GlyphVector, which requires FontRenderContext, which is obtained from Graphics2D, which is not available until the component is first drawn.

Possible solutions:
* Create a dummy FontRenderContext for boundingbox measurement. There are only a few parameters there and they are not very important (line antialiasing). So, the result should probably not change by much. :-\
* Feed the Graphics2D or FontRenderContext to getBoundingBox :-\
* Never rely on getBoundingBox() before the first call to draw() :-\
* Your solution?

Changed in workcraft:
importance: Undecided → Low
Changed in workcraft:
milestone: none → 3.0
tags: added: group
Changed in workcraft:
status: New → Confirmed
tags: removed: group
Changed in workcraft:
milestone: 3.0 → none
importance: Low → Wishlist
importance: Wishlist → Low
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.