mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Cleaned up the calculation of bounds of symbols, this fixes bounds calculation with symmetries.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1178 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -116,9 +116,11 @@ bool SymbolPartsSelection::selectRect(const Vector2D& a, const Vector2D& b, cons
|
||||
}
|
||||
bool SymbolPartsSelection::selectRect(const SymbolGroup& parent, const Vector2D& a, const Vector2D& b, const Vector2D& c) {
|
||||
bool changes = false;
|
||||
Bounds ab(a); ab.update(b);
|
||||
Bounds bc(b); bc.update(c);
|
||||
FOR_EACH_CONST(p, parent.parts) {
|
||||
bool in_ab = (p->min_pos.x >= min(a.x, b.x) && p->min_pos.y >= min(a.y, b.y) && p->max_pos.x <= max(a.x, b.x) && p->max_pos.y <= max(a.y, b.y));
|
||||
bool in_bc = (p->min_pos.x >= min(a.x, c.x) && p->min_pos.y >= min(a.y, c.y) && p->max_pos.x <= max(a.x, c.x) && p->max_pos.y <= max(a.y, c.y));
|
||||
bool in_ab = ab.contains(p->bounds);
|
||||
bool in_bc = bc.contains(p->bounds);
|
||||
if (in_ab != in_bc) {
|
||||
select(p, SELECT_TOGGLE);
|
||||
changes = true;
|
||||
|
||||
Reference in New Issue
Block a user