diff --git a/toonz/sources/tnztools/toonzrasterbrushtool.cpp b/toonz/sources/tnztools/toonzrasterbrushtool.cpp index 1025128..0cfacbf 100644 --- a/toonz/sources/tnztools/toonzrasterbrushtool.cpp +++ b/toonz/sources/tnztools/toonzrasterbrushtool.cpp @@ -1501,12 +1501,15 @@ void ToonzRasterBrushTool::inputPaintTrackPoint(const TTrackPoint &point, const if (firstTrack) { // for the first track we will paint cursor circle // here we will invalidate rects for it - TPointD thickOffset(m_maxCursorThick*0.5, m_maxCursorThick*0.5); - invalidateRect += TRectD(m_brushPos - thickOffset, m_brushPos + thickOffset); + double thickness = m_isMyPaintStyleSelected ? m_maxCursorThick : m_maxThick*0.5; + TPointD thickOffset(thickness + 1, thickness + 1); + invalidateRect += TRectD(m_brushPos - thickOffset, m_brushPos + thickOffset); invalidateRect += TRectD(point.position - thickOffset, point.position + thickOffset); m_brushPos = m_mousePos = point.position; } - invalidate(invalidateRect.enlarge(2)); + + if (!invalidateRect.isEmpty()) + invalidate(invalidateRect.enlarge(2)); } //--------------------------------------------------------------------------------------------------------------- @@ -1524,18 +1527,7 @@ void ToonzRasterBrushTool::inputMouseMove(const TPointD &position, const TInputS TTool::getApplication()->getCurrentTool()->notifyToolChanged(); } - void addMinMax(TDoublePairProperty &prop, double add) { - if (add == 0.0) return; - const TDoublePairProperty::Range &range = prop.getRange(); - - TDoublePairProperty::Value value = prop.getValue(); - value.first = tcrop(value.first + add, range.first, range.second); - value.second = tcrop(value.second + add, range.first, range.second); - - setValue(prop, value); - } - - void addMinMaxSeparate(TDoublePairProperty &prop, double min, double max) { + void addMinMax(TDoublePairProperty &prop, double min, double max) { if (min == 0.0 && max == 0.0) return; const TDoublePairProperty::Range &range = prop.getRange(); @@ -1548,7 +1540,6 @@ void ToonzRasterBrushTool::inputMouseMove(const TPointD &position, const TInputS setValue(prop, value); } - } locals = {this}; double thickness = @@ -1566,7 +1557,7 @@ void ToonzRasterBrushTool::inputMouseMove(const TPointD &position, const TInputS double max = diff.x / 2; double min = diff.y / 2; - locals.addMinMaxSeparate(m_rasThickness, min, max); + locals.addMinMax(m_rasThickness, min, max); double radius = m_rasThickness.getValue().second * 0.5; invalidateRect += TRectD(m_brushPos - TPointD(radius, radius),