Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

fix geometric tool / type tool offset

shun-iwasawa01dafaf33ab6
diff --git a/toonz/sources/tnztools/geometrictool.cpp b/toonz/sources/tnztools/geometrictool.cpp
index d7f337063..52d0838dd 100644
--- a/toonz/sources/tnztools/geometrictool.cpp
+++ b/toonz/sources/tnztools/geometrictool.cpp
@@ -1022,19 +1022,23 @@ public:
}
}
+ bool preLeftButtonDown() override {
+ if (getViewer() && getViewer()->getGuidedStrokePickerMode()) return false;
+
+ if (!getApplication()->getCurrentObject()->isSpline())
+ // NEEDS to be done even if(m_active), due
+ // to the HORRIBLE m_frameCreated / m_levelCreated
+ // mechanism. touchImage() is the ONLY function
+ // resetting them to false... >_<
+ m_active = !!touchImage();
+ return true;
+ }
+
void leftButtonDown(const TPointD &p, const TMouseEvent &e) override {
if (getViewer() && getViewer()->getGuidedStrokePickerMode()) {
getViewer()->doPickGuideStroke(p);
return;
}
-
- /* m_active = getApplication()->getCurrentObject()->isSpline() ||
- (bool) getImage(true);*/
- if (!getApplication()->getCurrentObject()->isSpline())
- m_active = touchImage(); // NEEDS to be done even if(m_active), due
- if (!m_active) // to the HORRIBLE m_frameCreated / m_levelCreated
- return; // mechanism. touchImage() is the ONLY function
- // resetting them to false... >_<
if (m_primitive) m_primitive->leftButtonDown(p, e);
invalidate();
}
diff --git a/toonz/sources/tnztools/typetool.cpp b/toonz/sources/tnztools/typetool.cpp
index d495d254c..d62bffc39 100644
--- a/toonz/sources/tnztools/typetool.cpp
+++ b/toonz/sources/tnztools/typetool.cpp
@@ -358,6 +358,7 @@ public:
void setCursorIndexFromPoint(TPointD point);
void mouseMove(const TPointD &pos, const TMouseEvent &) override;
+ bool preLeftButtonDown() override;
void leftButtonDown(const TPointD &pos, const TMouseEvent &) override;
void rightButtonDown(const TPointD &pos, const TMouseEvent &) override;
bool keyDown(QKeyEvent *event) override;
@@ -1201,6 +1202,16 @@ void TypeTool::mouseMove(const TPointD &pos, const TMouseEvent &) {
//---------------------------------------------------------
+bool TypeTool::preLeftButtonDown() {
+ if (getViewer() && getViewer()->getGuidedStrokePickerMode()) return false;
+
+ if (m_validFonts && !m_active)
+ touchImage();
+ return true;
+}
+
+//---------------------------------------------------------
+
void TypeTool::leftButtonDown(const TPointD &pos, const TMouseEvent &) {
TSelection::setCurrent(0);
@@ -1211,11 +1222,7 @@ void TypeTool::leftButtonDown(const TPointD &pos, const TMouseEvent &) {
if (!m_validFonts) return;
- TImageP img;
- if (!m_active)
- img = touchImage();
- else
- img = getImage(true);
+ TImageP img = getImage(true);
TVectorImageP vi = img;
TToonzImageP ti = img;