Skip to content

Commit

Permalink
Fix brush tool on rasters with different sizes (opentoonz#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Bullock authored and shun-iwasawa committed Dec 9, 2020
1 parent 3073c05 commit 8c1a467
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions toonz/sources/tnztools/fullcolorbrushtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 8c1a467

Please sign in to comment.