fix geometric tool / type tool offset
This commit is contained in:
parent
4cb2f6fd40
commit
8358fc99ce
2 changed files with 24 additions and 13 deletions
|
@ -1032,19 +1032,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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue