From 48b79b912c1cd57f4069364b4cf4d4bd3a3dfe60 Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Sun, 29 Nov 2009 03:20:45 -0800 Subject: [PATCH] Draw the filled contours last, so that transparency (for the default fill color for closed non-self-intersecting contours) works correctly. [git-p4: depot-paths = "//depot/solvespace/": change = 2081] --- draw.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/draw.cpp b/draw.cpp index 0602c99..0b69870 100644 --- a/draw.cpp +++ b/draw.cpp @@ -648,14 +648,6 @@ void GraphicsWindow::Paint(int w, int h) { nogrid:; } - // Draw filled paths in all groups, when those filled paths were requested - // specially by assigning a style with a fill color. - Group *g; - for(g = SK.group.First(); g; g = SK.group.NextAfter(g)) { - if(!(g->IsVisible())) continue; - g->DrawFilledPaths(); - } - // Draw the active group; this does stuff like the mesh and edges. (SK.GetGroup(activeGroup))->Draw(); @@ -663,6 +655,17 @@ nogrid:; if(showHdnLines) glDisable(GL_DEPTH_TEST); Entity::DrawAll(); + // Draw filled paths in all groups, when those filled paths were requested + // specially by assigning a style with a fill color, or when the filled + // paths are just being filled by default. This should go last, to make + // the transparency work. + Group *g; + for(g = SK.group.First(); g; g = SK.group.NextAfter(g)) { + if(!(g->IsVisible())) continue; + g->DrawFilledPaths(); + } + + glDisable(GL_DEPTH_TEST); // Draw the constraints for(i = 0; i < SK.constraint.n; i++) {