Ignore:
Timestamp:
2015-05-17T15:52:24+02:00 (9 years ago)
Author:
Don-vip
Message:

squid:S1244 - Floating point numbers should not be tested for equality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/Layer.java

    r8378 r8384  
    3131import org.openstreetmap.josm.tools.Destroyable;
    3232import org.openstreetmap.josm.tools.ImageProvider;
     33import org.openstreetmap.josm.tools.Utils;
    3334
    3435/**
     
    269270        boolean oldValue = isVisible();
    270271        this.visible  = visible;
    271         if (visible && opacity == 0) {
     272        if (visible && Double.doubleToRawLongBits(opacity) == 0) {
    272273            setOpacity(1);
    273274        } else if (oldValue != isVisible()) {
     
    281282     */
    282283    public boolean isVisible() {
    283         return visible && opacity != 0;
     284        return visible && Double.doubleToRawLongBits(opacity) != 0;
    284285    }
    285286
     
    294295        boolean oldVisible = isVisible();
    295296        this.opacity = opacity;
    296         if (oldOpacity != getOpacity()) {
     297        if (!Utils.equalsEpsilon(oldOpacity, getOpacity())) {
    297298            fireOpacityChanged(oldOpacity, getOpacity());
    298299        }
Note: See TracChangeset for help on using the changeset viewer.