Ignore:
Timestamp:
06/20/08 13:33:11 (16 years ago)
Author:
ra33
Message:

Changed all the (int)(x+0.5) float conversions to use the Math.round(x) which does Math.floor(x+0.5F) so that negative numbers are rounded properly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/FrameGraphics.java

    r105 r106  
    279279                        i.setActionMark(false);
    280280                        if (!(i instanceof Line)) {
    281                                 i.setXY((int) (i.getX() * scale + dx + 0.5), (int) (i.getY()
    282                                                 * scale + dy + 0.5));
    283                                 i.setThickness((int) (i.getThickness() * scale + 0.5));
     281                                i.setXY(Math.round(i.getX() * scale + dx), Math.round(i.getY()
     282                                                * scale + dy));
     283                                i.setThickness(Math.round(i.getThickness() * scale));
    284284                                i
    285                                                 .setArrowheadLength((int) (i.getArrowheadLength()
    286                                                                 * scale + 0.5));
     285                                                .setArrowheadLength(Math.round(i.getArrowheadLength()
     286                                                                * scale));
    287287                                if (i.getColor() == null) {
    288288                                        i.setColor(defaultForeground);
     
    296296                        }
    297297                        if (i instanceof Text)
    298                                 i.setSize((int) (i.getSize() * scale + 0.5));
     298                                i.setSize(Math.round(i.getSize() * scale));
    299299                        items.add(i);
    300300                }
Note: See TracChangeset for help on using the changeset viewer.