Skip to content

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

C

FillTool: Use `Shift` to disable `Empty Only` temporarily

Abel You916a6a466017
diff --git a/toonz/sources/tnztools/filltool.cpp b/toonz/sources/tnztools/filltool.cpp
index 72d92c324..d2b6da502 100644
--- a/toonz/sources/tnztools/filltool.cpp
+++ b/toonz/sources/tnztools/filltool.cpp
@@ -2227,6 +2227,11 @@ void FillTool::leftButtonDown(const TPointD &pos, const TMouseEvent &e) {
if (m_isAltPressed)
Preferences::instance()->setValue(PreferencesItemId::DefRegionWithPaint,
!DEF_REGION_WITH_PAINT);
+ m_restoreEmptyOnly = e.isShiftPressed() && m_emptyOnly.getValue();
+ if (m_restoreEmptyOnly) {
+ m_emptyOnly.setValue(false);
+ onPropertyChanged(m_emptyOnly.getName(), false);
+ }
m_clickPoint = pos;
// Area mode
@@ -2382,6 +2387,10 @@ void FillTool::leftButtonUp(const TPointD &pos, const TMouseEvent &e) {
if (m_isAltPressed)
Preferences::instance()->setValue(PreferencesItemId::DefRegionWithPaint,
(!DEF_REGION_WITH_PAINT));
+ if (m_restoreEmptyOnly) {
+ m_emptyOnly.setValue(true);
+ onPropertyChanged(m_emptyOnly.getName(), false);
+ }
}
//-----------------------------------------------------------------------------
diff --git a/toonz/sources/tnztools/filltool.h b/toonz/sources/tnztools/filltool.h
index 1ec19dd0b..e48887d53 100644
--- a/toonz/sources/tnztools/filltool.h
+++ b/toonz/sources/tnztools/filltool.h
@@ -125,6 +125,7 @@ class FillTool final : public QObject, public TTool {
RefImgTable m_refImgTable; // imageId
bool m_isAltPressed = false;
+ bool m_restoreEmptyOnly;
public:
FillTool(int targetType);