mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 21:47:00 -04:00
Fixed 'subtract' symbol combine mode
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@417 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -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
|
|||||||
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
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
|||||||
}
|
}
|
||||||
// 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]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user