Depending on the fact the segment relies on contacts or not the translate method behavior is different (useful pour device layout)
This commit is contained in:
Damien Dupuis 2009-11-26 12:21:02 +00:00
parent dda0af6966
commit e208fbeb2f
2 changed files with 20 additions and 0 deletions

View File

@ -125,6 +125,16 @@ void Horizontal::translate(const DbU::Unit& dx, const DbU::Unit& dy)
invalidate(true);
_y += dy;
}
if (dx != 0) {
if (!getSourceHook()->isAttached()) {
invalidate(true);
_dxSource += dx;
}
if (!getTargetHook()->isAttached()) {
invalidate(true);
_dxTarget += dx;
}
}
}
void Horizontal::setY(const DbU::Unit& y)

View File

@ -128,6 +128,16 @@ void Vertical::translate(const DbU::Unit& dx, const DbU::Unit& dy)
invalidate(true);
_x += dx;
}
if (dy != 0) {
if (!getSourceHook()->isAttached()) {
invalidate(true);
_dySource += dy;
}
if (!getTargetHook()->isAttached()) {
invalidate(true);
_dyTarget += dy;
}
}
}
void Vertical::setX(const DbU::Unit& x)