From e208fbeb2f0aa170999f394618edd9a31bfef9c6 Mon Sep 17 00:00:00 2001 From: Damien Dupuis Date: Thu, 26 Nov 2009 12:21:02 +0000 Subject: [PATCH] CHANGES Depending on the fact the segment relies on contacts or not the translate method behavior is different (useful pour device layout) --- hurricane/src/hurricane/Horizontal.cpp | 10 ++++++++++ hurricane/src/hurricane/Vertical.cpp | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/hurricane/src/hurricane/Horizontal.cpp b/hurricane/src/hurricane/Horizontal.cpp index 133dcd26..a342922b 100644 --- a/hurricane/src/hurricane/Horizontal.cpp +++ b/hurricane/src/hurricane/Horizontal.cpp @@ -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) diff --git a/hurricane/src/hurricane/Vertical.cpp b/hurricane/src/hurricane/Vertical.cpp index 3c40aef7..3a72b3b9 100644 --- a/hurricane/src/hurricane/Vertical.cpp +++ b/hurricane/src/hurricane/Vertical.cpp @@ -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)