Ignore:
Timestamp:
11/19/20 13:41:28 (3 years ago)
Author:
bnemhaus
Message:

Expeditee now respects the users antialiasing setting. The previous system

  1. Attempted to respect antialiasing by checking the setting and enabling it if the setting was true
  2. In the process of painting the frame some special items (link marks etc) want to use antialiasing reguardless of setting. This was achieved by turning antialiasing on, doing the thing and then turning it off. This unfortunately meant that, in the scenario that the users antialiasing setting is on, it gets turned off after drawing one of these special items and doesn't get turn on again until all items have been drawn.

The new system still always turns antialiasing on for these special items, but instead of turning it off after, it returns it to the setting it was previously on. This is achieved with two new functions: setTransientAntialiasingOn() and setTransientAntialiasingOff().

On a related note, there was also an issue with some polygons being drawn with a thickness of 0.0f, which was causing them to antialias badly. They now have a thickness of 1.0f.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/Item.java

    r1519 r1545  
    105105        public static final Float DEFAULT_THICKNESS = 2f;
    106106
    107         public static final Float MINIMUM_THICKNESS = 0f;
     107        public static final Float MINIMUM_THICKNESS = 1f;
    108108
    109109        public static final Float MINIMUM_PAINT_THICKNESS = 1f;
     
    31703170
    31713171                        // Small circles look rubbish without AA. cts16
    3172                         g.setAntialiasing(true);
     3172                        g.setTransientAntialiasingOn();
    31733173                       
    31743174                        if (hasLink && getLinkMark()) {
     
    31903190                        }
    31913191                       
    3192                         g.setAntialiasing(false);
     3192                        g.setTransientAntialiasingOff();
    31933193                }
    31943194        }
     
    32083208               
    32093209                GraphicsManager g = EcosystemManager.getGraphicsManager();
    3210                 g.setAntialiasing(true);
     3210                g.setTransientAntialiasingOn();
    32113211                Font font = new Font();
    32123212                g.drawString("\uD83D\uDD11", new Point(x,y), font, fontColour);
    3213                 g.setAntialiasing(false);
     3213                g.setTransientAntialiasingOff();
    32143214        }
    32153215       
     
    32183218                if (encryptionLabel != null && encryptionLabel.length() > 0) {
    32193219                        GraphicsManager g = EcosystemManager.getGraphicsManager();
    3220                         g.setAntialiasing(true);
     3220                        g.setTransientAntialiasingOn();
    32213221                        Font font = new Font();
    32223222                        g.drawString("\uD83D\uDD12", new Point(x,y), font, Colour.BLACK);
    3223                         g.setAntialiasing(false);
     3223                        g.setTransientAntialiasingOff();
    32243224                }
    32253225        }
Note: See TracChangeset for help on using the changeset viewer.