summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 89bbc9f)
raw | patch | inline | side by side (parent: 89bbc9f)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Fri, 30 Mar 2007 19:04:54 +0000 (19:04 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Fri, 30 Mar 2007 19:04:54 +0000 (19:04 +0000) |
src/sp-item.cpp | patch | blob | history | |
src/sp-item.h | patch | blob | history | |
src/sp-shape.cpp | patch | blob | history |
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 27f6e4ce38d31dcedfd4920ac143774b82b41d6f..28d8ed6bcef6f28a667cc170dd9964dd6910c243 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
return (transform_center_x != 0 || transform_center_y != 0);
}
-NR::Point SPItem::getCenter() {
+NR::Point SPItem::getCenter() const {
NR::Maybe<NR::Rect> bbox = getBounds(sp_item_i2d_affine(this));
if (bbox) {
return bbox->midpoint() + NR::Point (this->transform_center_x, this->transform_center_y);
diff --git a/src/sp-item.h b/src/sp-item.h
index eb7043096d45ba1d2ba400252505db27b06acd63..9359763b5957d0e3de6418883ba6954ea3dc15c1 100644 (file)
--- a/src/sp-item.h
+++ b/src/sp-item.h
void setCenter(NR::Point object_centre);
void unsetCenter();
bool isCenterSet();
- NR::Point getCenter();
+ NR::Point getCenter() const;
bool isVisibleAndUnlocked() const;
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index 453de5650fd017971a280a7c1c7ad069e69446cf..a37da6840540274e02e0cb98772ee84d3fa80ab9 100644 (file)
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
*p = bp->c(3) * i2d;
bp++;
}
+
+ // Additionaly, add the center for snapping
+ *p = shape->getCenter();
+
}