Commit c40c3fa0 authored by twanvl's avatar twanvl

Fixed 'subtract' symbol combine mode

parent 47809857
...@@ -138,7 +138,7 @@ void SymbolViewer::highlightPart(DC& dc, const SymbolPart& part, HighlightStyle ...@@ -138,7 +138,7 @@ void SymbolViewer::highlightPart(DC& dc, const SymbolPart& part, HighlightStyle
void SymbolViewer::combineSymbolPart(const SymbolPart& part, DC& border, DC& interior, bool directB, bool directI) { void SymbolViewer::combineSymbolPart(const SymbolPart& part, DC& border, DC& interior, bool directB, bool directI) {
// what color should the interior be? // what color should the interior be?
// use black when drawing to the screen // use black when drawing to the screen
unsigned char interiorCol = directI ? 0 : 255; Byte interiorCol = directI ? 0 : 255;
// how to draw depends on combining mode // how to draw depends on combining mode
switch(part.combine) { switch(part.combine) {
case PART_OVERLAP: case PART_OVERLAP:
...@@ -147,7 +147,7 @@ void SymbolViewer::combineSymbolPart(const SymbolPart& part, DC& border, DC& int ...@@ -147,7 +147,7 @@ void SymbolViewer::combineSymbolPart(const SymbolPart& part, DC& border, DC& int
break; break;
} case PART_SUBTRACT: { } case PART_SUBTRACT: {
border.SetLogicalFunction(wxAND); border.SetLogicalFunction(wxAND);
drawSymbolPart(part, &border, &interior, 0, ~interiorCol, true, true); drawSymbolPart(part, &border, &interior, 0, ~interiorCol, directB, false);
border.SetLogicalFunction(wxCOPY); border.SetLogicalFunction(wxCOPY);
break; break;
} case PART_INTERSECTION: { } case PART_INTERSECTION: {
...@@ -172,7 +172,7 @@ void SymbolViewer::combineSymbolPart(const SymbolPart& part, DC& border, DC& int ...@@ -172,7 +172,7 @@ void SymbolViewer::combineSymbolPart(const SymbolPart& part, DC& border, DC& int
} }
} }
void SymbolViewer::drawSymbolPart(const SymbolPart& part, DC* border, DC* interior, unsigned char borderCol, unsigned char interiorCol, bool directB, bool clear) { void SymbolViewer::drawSymbolPart(const SymbolPart& part, DC* border, DC* interior, Byte borderCol, Byte interiorCol, bool directB, bool clear) {
// create point list // create point list
vector<wxPoint> points; vector<wxPoint> points;
size_t size = part.points.size(); size_t size = part.points.size();
...@@ -181,8 +181,8 @@ void SymbolViewer::drawSymbolPart(const SymbolPart& part, DC* border, DC* interi ...@@ -181,8 +181,8 @@ void SymbolViewer::drawSymbolPart(const SymbolPart& part, DC* border, DC* interi
} }
// draw border // draw border
if (border) { if (border) {
// white/black // white/black or, if directB white/green
border->SetBrush(Color(borderCol, borderCol^(directB ? 128 : 0), borderCol)); border->SetBrush(Color(borderCol, (directB && borderCol == 0 ? 128 : borderCol), borderCol));
border->SetPen(wxPen(*wxWHITE, (int) rotation.trS(border_radius))); border->SetPen(wxPen(*wxWHITE, (int) rotation.trS(border_radius)));
border->DrawPolygon((int)points.size(), &points[0]); border->DrawPolygon((int)points.size(), &points[0]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment