Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: UDIG 1.2.RC2
-
Fix Version/s: UDIG 1.2.0
-
Component/s: framework
-
Labels:None
-
Environment:Observed on Ubuntu 9.10 32 bit, but OS-independent
Description
RenderContextImpl throws exception when using a MapViewer and (indirectly) calling refesh on the render manager. This only happens when the control (UI) on which the renderer renders has zero dimensions (as it is the case when it hasn't being shown yet).
The fix is something like check for illegal dimensions before returning the image.
/**
- Provide a BufferedImage of the correct size for the map display.
* - @return BufferedImage for use by the Renderer
*/
public BufferedImage getImage() {
if (getImageSize().width < 1 || getImageSize().height < 1)
{ return dummyImage; } return getImage(getImageSize().width, getImageSize().height);
}
Something similar is done in getImage(int,int)