Skip to content

Commit

Permalink
Merge pull request #4045 from kwvanderlinde/refactor/4002-fix-lumens-…
Browse files Browse the repository at this point in the history
…overlay-transparency

Fill the lumens overlay properly
  • Loading branch information
cwisniew authored May 9, 2023
2 parents f0c70b5 + 0447c4f commit 9fa5c9f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1509,16 +1509,17 @@ private void renderLumensOverlay(
timer.stop("renderLumensOverlay:allocateBuffer");

Graphics2D newG = lumensOverlay.createGraphics();
newG.setComposite(AlphaComposite.SrcOver.derive(overlayOpacity));
SwingUtil.useAntiAliasing(newG);

// At night, show any uncovered areas as dark. In daylight, show them as light (clear).
newG.setComposite(AlphaComposite.Src.derive(overlayOpacity));
newG.setPaint(
zone.getVisionType() == Zone.VisionType.NIGHT
? new Color(0.f, 0.f, 0.f, 1.f)
: new Color(0.f, 0.f, 0.f, 0.f));
newG.fillRect(0, 0, lumensOverlay.getWidth(), lumensOverlay.getHeight());

newG.setComposite(AlphaComposite.SrcOver.derive(overlayOpacity));
SwingUtil.useAntiAliasing(newG);

if (clipStyle != null && visibleScreenArea != null) {
timer.start("renderLumensOverlay:setClip");
Area clip = new Area(g.getClip());
Expand Down

0 comments on commit 9fa5c9f

Please sign in to comment.