Uploaded image for project: 'Apache Hop (Retired)'
  1. Apache Hop (Retired)
  2. HOP-2243

GuiResource is buggy with same image in two different sizes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.50
    • GUI
    • None

    Description

      I think GuiResource is buggy when we want to get the same image in two different sizes.

       

      I propose to correct as follows:

      public Image getImage( String location, ClassLoader classLoader, int width, int height ) {
      // Build image key for a specific size
      ++ StringBuilder builder = new StringBuilder(location);
      ++ builder.append('|');
      ++ builder.append(width);
      ++ builder.append('|');
      ++ builder.append(height);
      ++ String key = builder.toString();
      – Image image = imageMap.get( location );
      ++ Image image = imageMap.get( key );
      if ( image == null )

      { SwtUniversalImage svg = SwtSvgImageUtil.getUniversalImage( display, classLoader, location ); image = new Image( display, getZoomedImaged( svg, display, width, height ), SWT.IMAGE_COPY ); svg.dispose(); ++ imageMap.put( key, image ); -- imageMap.put( location, image ); }

      return image;
      }

      Attachments

        Activity

          People

            nadment Nicolas Adment
            nadment Nicolas Adment
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: