Changeset 5045 in josm for trunk/src


Ignore:
Timestamp:
2012-03-05T20:42:06+01:00 (8 years ago)
Author:
Don-vip
Message:

fix #7456 - alpha value out of range

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java

    r4822 r5045  
    4747import org.openstreetmap.josm.gui.mappaint.BoxTextElemStyle.VerticalTextAlignment;
    4848import org.openstreetmap.josm.gui.mappaint.MapImage;
    49 import org.openstreetmap.josm.gui.mappaint.NodeElemStyle;
    5049import org.openstreetmap.josm.gui.mappaint.NodeElemStyle.Symbol;
    5150import org.openstreetmap.josm.gui.mappaint.TextElement;
    5251import org.openstreetmap.josm.tools.ImageProvider;
    5352import org.openstreetmap.josm.tools.Pair;
     53import org.openstreetmap.josm.tools.Utils;
    5454
    5555public class MapPainter {
     
    820820                        new Rectangle(0, 0, fillImage.img.getWidth(null), fillImage.img.getHeight(null)));
    821821                g.setPaint(texture);
    822                 if (fillImage.alpha != 1f) {
    823                     g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, fillImage.alpha));
     822                Float alpha = Utils.color_int2float(fillImage.alpha);
     823                if (alpha != 1f) {
     824                    g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
    824825                }
    825826                g.fill(area);
Note: See TracChangeset for help on using the changeset viewer.