From cad65b86b71d3621e90a386ee150c513ed6d6640 Mon Sep 17 00:00:00 2001 From: Rodney Date: Oct 11 2020 14:00:20 +0000 Subject: Merge pull request #3523 from pojienie/selective-option-for-segment-eraser implement selective option for segment eraser --- diff --git a/toonz/sources/tnztools/vectorerasertool.cpp b/toonz/sources/tnztools/vectorerasertool.cpp index 2155597..766a7a0 100644 --- a/toonz/sources/tnztools/vectorerasertool.cpp +++ b/toonz/sources/tnztools/vectorerasertool.cpp @@ -1262,6 +1262,7 @@ void EraserTool::eraseSegments(const TVectorImageP vi, TStroke *eraseStroke) { if (!vi || !eraseStroke) return; int strokeNumber = vi->getStrokeCount(); + int colorStyle = TTool::getApplication()->getCurrentLevelStyleIndex(); std::vector touchedStrokeIndex; std::vector> touchedStrokeW; std::vector> touchedStrokeRanges; @@ -1273,6 +1274,10 @@ void EraserTool::eraseSegments(const TVectorImageP vi, TStroke *eraseStroke) { TStroke *stroke = vi->getStroke(i); bool touched = false; + if (m_selective.getValue() && stroke->getStyle() != colorStyle) { + continue; + } + intersect(eraseStroke, stroke, intersections, false); for (auto &intersection : intersections) {