Skip to content

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

C

Fix brush tool on rasters with different sizes (#38)

Jeremy Bullock8c1a4673a26f
diff --git a/toonz/sources/tnztools/fullcolorbrushtool.cpp b/toonz/sources/tnztools/fullcolorbrushtool.cpp
index 765cbbd6b..f16c69097 100644
--- a/toonz/sources/tnztools/fullcolorbrushtool.cpp
+++ b/toonz/sources/tnztools/fullcolorbrushtool.cpp
@@ -304,7 +304,7 @@ void FullColorBrushTool::leftButtonDown(const TPointD &pos,
if (!viewer) return;
TRasterImageP ri = (TRasterImageP)getImage(true);
- if (!ri) ri = (TRasterImageP)touchImage();
+ if (!ri) ri = (TRasterImageP)touchImage();
if (!ri) return;
@@ -580,12 +580,12 @@ void FullColorBrushTool::setWorkAndBackupImages() {
TRasterP ras = ri->getRaster();
TDimension dim = ras->getSize();
- if (!m_workRaster || m_workRaster->getLx() > dim.lx ||
- m_workRaster->getLy() > dim.ly)
+ if (!m_workRaster || m_workRaster->getLx() != dim.lx ||
+ m_workRaster->getLy() != dim.ly)
m_workRaster = TRaster32P(dim);
- if (!m_backUpRas || m_backUpRas->getLx() > dim.lx ||
- m_backUpRas->getLy() > dim.ly ||
+ if (!m_backUpRas || m_backUpRas->getLx() != dim.lx ||
+ m_backUpRas->getLy() != dim.ly ||
m_backUpRas->getPixelSize() != ras->getPixelSize())
m_backUpRas = ras->create(dim.lx, dim.ly);