uDIG
  1. uDIG
  2. UDIG-1641

RenderContextImpl fails when MapViewer not shown yet

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major 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)

        Activity

          People

          • Assignee:
            Jody Garnett
            Reporter:
            Ugo Taddei
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: