Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gmf-dev] Inconsistencies in MapModeGraphics and IMapMode


I was doing some performance tests on using SVG's to paint the background of figures. I noticed that my SVG was being re-rendered by Batik even if the size of the image was not changing.

I did some debugging and found that this is caused by several inconsistencies and round off errors in the handling of IMapMode.

In HiMetricMapMode, LPtoDP and DPtoLP use Math.round(), but MapModeGraphics uses Math.floor() everywhere. I fixed this by changing the round() to a floor().

It is impossible to cache the RenderedImage that is drawn by RenderedMapModeGraphics. The rendered image that is sent to the MapModeGraphics is resized according to MapModeGraphics. I don't know what the size of this new image is, so I can't hold onto a cached version of this graphic in my Figure.

This also happens when the editor is zoomed. This is because ScaledGraphics scales the rendered image to a new size, but my figure doesn't know what this is going to be, so there's no way I can cache it. Also ScaledGraphics uses Math.round(). Should this be floor just to be consistent?

https://bugs.eclipse.org/bugs/show_bug.cgi?id=110242

Thanks,

Mindaugas Idzelis
IBM Rational Middleware

Back to the top