diff --git a/toonz/sources/include/tools/cursors.h b/toonz/sources/include/tools/cursors.h index 16eec82..fce7f2a 100644 --- a/toonz/sources/include/tools/cursors.h +++ b/toonz/sources/include/tools/cursors.h @@ -60,42 +60,12 @@ enum { NormalEraserCursor, RectEraserCursor, - RectEraserCursorWhite, - FillCursorWhite, - TapeCursorWhite, - PickerCursorWhite, - PickerCursorWhiteLine, - PickerCursorWhiteArea, PickerCursorOrganize, - PickerCursorWhiteOrganize, PickerRGB, PickerRGBWhite, - FillCursorF, - FillCursorFWhite, - FillCursorP, - FillCursorPWhite, - FillCursorR, - FillCursorRWhite, - - FillCursorA, - FillCursorAWhite, - FillCursorAF, - FillCursorAFWhite, - FillCursorAP, - FillCursorAPWhite, - FillCursorAR, - FillCursorARWhite, - FillCursorL, - FillCursorLWhite, - FillCursorLF, - FillCursorLFWhite, - FillCursorLP, - FillCursorLPWhite, - FillCursorLR, - FillCursorLRWhite, MoveEWCursor, MoveNSCursor, @@ -105,7 +75,15 @@ enum { ScaleHVCursor, FxGadgetCursor, RulerModifyCursor, - RulerNewCursor + RulerNewCursor, + + // extra options for decorating the cursor + Ex_Negate = 0x100, // used for black bg + Ex_FreeHand = 0x200, + Ex_PolyLine = 0x400, + Ex_Rectangle = 0x800, + Ex_Line = 0x1000, + Ex_Area = 0x2000 }; } // namespace diff --git a/toonz/sources/tnztools/Resources/ex_area.png b/toonz/sources/tnztools/Resources/ex_area.png new file mode 100644 index 0000000..0bb477b Binary files /dev/null and b/toonz/sources/tnztools/Resources/ex_area.png differ diff --git a/toonz/sources/tnztools/Resources/ex_freehand.png b/toonz/sources/tnztools/Resources/ex_freehand.png new file mode 100644 index 0000000..03f4106 Binary files /dev/null and b/toonz/sources/tnztools/Resources/ex_freehand.png differ diff --git a/toonz/sources/tnztools/Resources/ex_line.png b/toonz/sources/tnztools/Resources/ex_line.png new file mode 100644 index 0000000..2b5f4a4 Binary files /dev/null and b/toonz/sources/tnztools/Resources/ex_line.png differ diff --git a/toonz/sources/tnztools/Resources/ex_polyline.png b/toonz/sources/tnztools/Resources/ex_polyline.png new file mode 100644 index 0000000..5a85884 Binary files /dev/null and b/toonz/sources/tnztools/Resources/ex_polyline.png differ diff --git a/toonz/sources/tnztools/Resources/ex_rectangle.png b/toonz/sources/tnztools/Resources/ex_rectangle.png new file mode 100644 index 0000000..d114a5a Binary files /dev/null and b/toonz/sources/tnztools/Resources/ex_rectangle.png differ diff --git a/toonz/sources/tnztools/Resources/fill.png b/toonz/sources/tnztools/Resources/fill.png index ab2f9d0..4087552 100644 Binary files a/toonz/sources/tnztools/Resources/fill.png and b/toonz/sources/tnztools/Resources/fill.png differ diff --git a/toonz/sources/tnztools/Resources/fill_a.png b/toonz/sources/tnztools/Resources/fill_a.png deleted file mode 100644 index 2fb3705..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_a.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_a_f.png b/toonz/sources/tnztools/Resources/fill_a_f.png deleted file mode 100644 index f75eba2..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_a_f.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_a_f_white.png b/toonz/sources/tnztools/Resources/fill_a_f_white.png deleted file mode 100644 index a97688a..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_a_f_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_a_p.png b/toonz/sources/tnztools/Resources/fill_a_p.png deleted file mode 100644 index 30c0c8a..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_a_p.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_a_p_white.png b/toonz/sources/tnztools/Resources/fill_a_p_white.png deleted file mode 100644 index 227bff0..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_a_p_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_a_r.png b/toonz/sources/tnztools/Resources/fill_a_r.png deleted file mode 100644 index 739a168..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_a_r.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_a_r_white.png b/toonz/sources/tnztools/Resources/fill_a_r_white.png deleted file mode 100644 index 97347a5..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_a_r_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_a_white.png b/toonz/sources/tnztools/Resources/fill_a_white.png deleted file mode 100644 index e9edc2b..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_a_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_f.png b/toonz/sources/tnztools/Resources/fill_f.png deleted file mode 100644 index 8cff607..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_f.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_f_white.png b/toonz/sources/tnztools/Resources/fill_f_white.png deleted file mode 100644 index 9dcb684..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_f_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_p.png b/toonz/sources/tnztools/Resources/fill_p.png deleted file mode 100644 index e11ac5b..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_p.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_p_white.png b/toonz/sources/tnztools/Resources/fill_p_white.png deleted file mode 100644 index 6cdcff4..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_p_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_r.png b/toonz/sources/tnztools/Resources/fill_r.png deleted file mode 100644 index fcc8ea6..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_r.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_r_white.png b/toonz/sources/tnztools/Resources/fill_r_white.png deleted file mode 100644 index a61421c..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_r_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/fill_white.png b/toonz/sources/tnztools/Resources/fill_white.png deleted file mode 100644 index 5514ea7..0000000 Binary files a/toonz/sources/tnztools/Resources/fill_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/karasu.png b/toonz/sources/tnztools/Resources/karasu.png index ed0e39c..dee1093 100644 Binary files a/toonz/sources/tnztools/Resources/karasu.png and b/toonz/sources/tnztools/Resources/karasu.png differ diff --git a/toonz/sources/tnztools/Resources/karasu_f.png b/toonz/sources/tnztools/Resources/karasu_f.png deleted file mode 100644 index c2cf80e..0000000 Binary files a/toonz/sources/tnztools/Resources/karasu_f.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/karasu_f_white.png b/toonz/sources/tnztools/Resources/karasu_f_white.png deleted file mode 100644 index 9ad844b..0000000 Binary files a/toonz/sources/tnztools/Resources/karasu_f_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/karasu_p.png b/toonz/sources/tnztools/Resources/karasu_p.png deleted file mode 100644 index ed963d6..0000000 Binary files a/toonz/sources/tnztools/Resources/karasu_p.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/karasu_p_white.png b/toonz/sources/tnztools/Resources/karasu_p_white.png deleted file mode 100644 index a4cac63..0000000 Binary files a/toonz/sources/tnztools/Resources/karasu_p_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/karasu_r.png b/toonz/sources/tnztools/Resources/karasu_r.png deleted file mode 100644 index b110e2a..0000000 Binary files a/toonz/sources/tnztools/Resources/karasu_r.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/karasu_r_white.png b/toonz/sources/tnztools/Resources/karasu_r_white.png deleted file mode 100644 index e1044ec..0000000 Binary files a/toonz/sources/tnztools/Resources/karasu_r_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/karasu_white.png b/toonz/sources/tnztools/Resources/karasu_white.png deleted file mode 100644 index b5266eb..0000000 Binary files a/toonz/sources/tnztools/Resources/karasu_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/normaleraser.png b/toonz/sources/tnztools/Resources/normaleraser.png index 68107c7..33015a3 100644 Binary files a/toonz/sources/tnztools/Resources/normaleraser.png and b/toonz/sources/tnztools/Resources/normaleraser.png differ diff --git a/toonz/sources/tnztools/Resources/picker_style_white.png b/toonz/sources/tnztools/Resources/picker_style_white.png deleted file mode 100644 index a9cd68d..0000000 Binary files a/toonz/sources/tnztools/Resources/picker_style_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/picker_style_white_area.png b/toonz/sources/tnztools/Resources/picker_style_white_area.png deleted file mode 100644 index 6292c37..0000000 Binary files a/toonz/sources/tnztools/Resources/picker_style_white_area.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/picker_style_white_line.png b/toonz/sources/tnztools/Resources/picker_style_white_line.png deleted file mode 100644 index 86221a3..0000000 Binary files a/toonz/sources/tnztools/Resources/picker_style_white_line.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/picker_style_white_organize.png b/toonz/sources/tnztools/Resources/picker_style_white_organize.png deleted file mode 100644 index 5e58682..0000000 Binary files a/toonz/sources/tnztools/Resources/picker_style_white_organize.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/recteraser.png b/toonz/sources/tnztools/Resources/recteraser.png index 9efd794..1bd963f 100644 Binary files a/toonz/sources/tnztools/Resources/recteraser.png and b/toonz/sources/tnztools/Resources/recteraser.png differ diff --git a/toonz/sources/tnztools/Resources/recteraser_white.png b/toonz/sources/tnztools/Resources/recteraser_white.png deleted file mode 100644 index 385b2e9..0000000 Binary files a/toonz/sources/tnztools/Resources/recteraser_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/Resources/tape.png b/toonz/sources/tnztools/Resources/tape.png index 6a8bc95..cc91d3c 100644 Binary files a/toonz/sources/tnztools/Resources/tape.png and b/toonz/sources/tnztools/Resources/tape.png differ diff --git a/toonz/sources/tnztools/Resources/tape_white.png b/toonz/sources/tnztools/Resources/tape_white.png deleted file mode 100644 index 6755b7a..0000000 Binary files a/toonz/sources/tnztools/Resources/tape_white.png and /dev/null differ diff --git a/toonz/sources/tnztools/cursormanager.cpp b/toonz/sources/tnztools/cursormanager.cpp index 323ba47..9cf1fd7 100644 --- a/toonz/sources/tnztools/cursormanager.cpp +++ b/toonz/sources/tnztools/cursormanager.cpp @@ -9,6 +9,7 @@ #include #include #include +#include namespace { @@ -22,7 +23,7 @@ const struct { {ToolCursor::CutterCursor, "cutter", 6, 24}, // 12,20}, {ToolCursor::EraserCursor, "eraser", 7, 21}, // 15,16}, {ToolCursor::DistortCursor, "selection_distort", 11, 6}, - {ToolCursor::FillCursor, "fill", 6, 23}, + {ToolCursor::FillCursor, "fill", 3, 26}, {ToolCursor::MoveCursor, "move", 15, 15}, {ToolCursor::MoveEWCursor, "move_ew", 15, 15}, {ToolCursor::MoveNSCursor, "move_ns", 15, 15}, @@ -54,7 +55,7 @@ const struct { {ToolCursor::ScaleGlobalCursor, "scale_global", 15, 15}, {ToolCursor::ScaleHVCursor, "scale_hv", 15, 15}, {ToolCursor::StrokeSelectCursor, "stroke_select", 11, 6}, - {ToolCursor::TapeCursor, "tape", 9, 23}, + {ToolCursor::TapeCursor, "tape", 4, 23}, {ToolCursor::TrackerCursor, "tracker", 12, 15}, {ToolCursor::TypeInCursor, "type_in", 16, 19}, {ToolCursor::TypeOutCursor, "type_out", 16, 19}, @@ -65,41 +66,12 @@ const struct { {ToolCursor::SplineEditorCursor, "stroke_select", 11, 6}, {ToolCursor::SplineEditorCursorAdd, "selection_add", 11, 6}, {ToolCursor::SplineEditorCursorSelect, "selection_convert", 11, 6}, - {ToolCursor::NormalEraserCursor, "normaleraser", 10, 21}, - {ToolCursor::RectEraserCursor, "recteraser", 10, 21}, - {ToolCursor::RectEraserCursorWhite, "recteraser_white", 10, 21}, - {ToolCursor::FillCursorWhite, "fill_white", 6, 23}, - {ToolCursor::TapeCursorWhite, "tape_white", 9, 23}, - {ToolCursor::PickerCursorWhiteLine, "picker_style_white_line", 7, 22}, - {ToolCursor::PickerCursorWhiteArea, "picker_style_white_area", 7, 22}, - {ToolCursor::PickerCursorWhite, "picker_style_white", 7, 22}, + {ToolCursor::NormalEraserCursor, "normaleraser", 3, 26}, + {ToolCursor::RectEraserCursor, "recteraser", 3, 26}, {ToolCursor::PickerCursorOrganize, "picker_style_organize", 7, 22}, - {ToolCursor::PickerCursorWhiteOrganize, "picker_style_white_organize", 7, - 22}, {ToolCursor::PickerRGB, "picker_rgb", 7, 22}, {ToolCursor::PickerRGBWhite, "picker_rgb_white", 7, 22}, - {ToolCursor::FillCursorF, "fill_f", 6, 23}, - {ToolCursor::FillCursorFWhite, "fill_f_white", 6, 23}, - {ToolCursor::FillCursorP, "fill_p", 6, 23}, - {ToolCursor::FillCursorPWhite, "fill_p_white", 6, 23}, - {ToolCursor::FillCursorR, "fill_r", 6, 23}, - {ToolCursor::FillCursorRWhite, "fill_r_white", 6, 23}, - {ToolCursor::FillCursorA, "fill_a", 6, 23}, - {ToolCursor::FillCursorAWhite, "fill_a_white", 6, 23}, - {ToolCursor::FillCursorAF, "fill_a_f", 6, 23}, - {ToolCursor::FillCursorAFWhite, "fill_a_f_white", 6, 23}, - {ToolCursor::FillCursorAP, "fill_a_p", 6, 23}, - {ToolCursor::FillCursorAPWhite, "fill_a_p_white", 6, 23}, - {ToolCursor::FillCursorAR, "fill_a_r", 6, 23}, - {ToolCursor::FillCursorARWhite, "fill_a_r_white", 6, 23}, - {ToolCursor::FillCursorL, "karasu", 6, 23}, - {ToolCursor::FillCursorLWhite, "karasu_white", 6, 23}, - {ToolCursor::FillCursorLF, "karasu_f", 6, 23}, - {ToolCursor::FillCursorLFWhite, "karasu_f_white", 6, 23}, - {ToolCursor::FillCursorLP, "karasu_p", 6, 23}, - {ToolCursor::FillCursorLPWhite, "karasu_p_white", 6, 23}, - {ToolCursor::FillCursorLR, "karasu_r", 6, 23}, - {ToolCursor::FillCursorLRWhite, "karasu_r_white", 6, 23}, + {ToolCursor::FillCursorL, "karasu", 7, 25}, {ToolCursor::RulerModifyCursor, "ruler_modify", 7, 7}, {ToolCursor::RulerNewCursor, "ruler_new", 7, 7}, {0, 0, 0, 0}}; @@ -108,6 +80,16 @@ struct CursorData { QPixmap pixmap; int x, y; }; + +const struct { + int decorateType; + const char *pixmapFilename; +} decorateInfo[] = {{ToolCursor::Ex_FreeHand, "ex_freehand"}, + {ToolCursor::Ex_PolyLine, "ex_polyline"}, + {ToolCursor::Ex_Rectangle, "ex_rectangle"}, + {ToolCursor::Ex_Line, "ex_line"}, + {ToolCursor::Ex_Area, "ex_area"}, + {0, 0}}; }; //============================================================================= @@ -126,22 +108,47 @@ public: return &_instance; } + void doDecoration(QPixmap &pixmap, int decorationFlag) { + if (decorationFlag == 0) return; + if (decorationFlag > ToolCursor::Ex_Negate) { + QPainter p(&pixmap); + p.setCompositionMode(QPainter::CompositionMode_SourceOver); + for (int i = 0; decorateInfo[i].pixmapFilename; i++) + if (decorationFlag & decorateInfo[i].decorateType) { + QString path = + QString(":Resources/") + decorateInfo[i].pixmapFilename + ".png"; + p.drawPixmap(0, 0, QPixmap(path)); + } + } + // negate + if (decorationFlag & ToolCursor::Ex_Negate) { + QImage img = pixmap.toImage(); + img.invertPixels(QImage::InvertRgb); // leave the alpha channel unchanged + pixmap = QPixmap::fromImage(img); + } + } + const CursorData &getCursorData(int cursorType) { // se e' gia' in tabella lo restituisco std::map::iterator it; it = m_cursors.find(cursorType); if (it != m_cursors.end()) return it->second; + + int decorationsFlag = cursorType & ~(0xFF); + int baseCursorType = cursorType & 0xFF; + // provo a cercarlo in cursorInfo[] int i; for (i = 0; cursorInfo[i].pixmapFilename; i++) - if (cursorType == cursorInfo[i].cursorType) { + if (baseCursorType == cursorInfo[i].cursorType) { QString path = QString(":Resources/") + cursorInfo[i].pixmapFilename + ".png"; CursorData data; data.pixmap = QPixmap(path); - data.x = cursorInfo[i].x; - data.y = cursorInfo[i].y; - it = m_cursors.insert(std::make_pair(cursorType, data)).first; + if (decorationsFlag != 0) doDecoration(data.pixmap, decorationsFlag); + data.x = cursorInfo[i].x; + data.y = cursorInfo[i].y; + it = m_cursors.insert(std::make_pair(cursorType, data)).first; return it->second; } // niente da fare. uso un default diff --git a/toonz/sources/tnztools/filltool.cpp b/toonz/sources/tnztools/filltool.cpp index 542df42..584dfb0 100644 --- a/toonz/sources/tnztools/filltool.cpp +++ b/toonz/sources/tnztools/filltool.cpp @@ -1775,48 +1775,23 @@ FillTool::FillTool(int targetType) //----------------------------------------------------------------------------- int FillTool::getCursorId() const { - bool isBlackBG = ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg; - - if (m_colorType.getValue() == LINES) { - if (m_fillType.getValue() == NORMALFILL) - return (isBlackBG) ? ToolCursor::FillCursorLWhite - : ToolCursor::FillCursorL; - else if (m_fillType.getValue() == FREEHANDFILL) - return (isBlackBG) ? ToolCursor::FillCursorLFWhite - : ToolCursor::FillCursorLF; - else if (m_fillType.getValue() == POLYLINEFILL) - return (isBlackBG) ? ToolCursor::FillCursorLPWhite - : ToolCursor::FillCursorLP; - else // Rect - return (isBlackBG) ? ToolCursor::FillCursorLRWhite - : ToolCursor::FillCursorLR; - } else if (m_colorType.getValue() == AREAS) { - if (m_fillType.getValue() == NORMALFILL) - return (isBlackBG) ? ToolCursor::FillCursorAWhite - : ToolCursor::FillCursorA; - else if (m_fillType.getValue() == FREEHANDFILL) - return (isBlackBG) ? ToolCursor::FillCursorAFWhite - : ToolCursor::FillCursorAF; - else if (m_fillType.getValue() == POLYLINEFILL) - return (isBlackBG) ? ToolCursor::FillCursorAPWhite - : ToolCursor::FillCursorAP; - else // Rect - return (isBlackBG) ? ToolCursor::FillCursorARWhite - : ToolCursor::FillCursorAR; - } else // line&areas - { - if (m_fillType.getValue() == NORMALFILL) - return (isBlackBG) ? ToolCursor::FillCursorWhite : ToolCursor::FillCursor; - else if (m_fillType.getValue() == FREEHANDFILL) - return (isBlackBG) ? ToolCursor::FillCursorFWhite - : ToolCursor::FillCursorF; - else if (m_fillType.getValue() == POLYLINEFILL) - return (isBlackBG) ? ToolCursor::FillCursorPWhite - : ToolCursor::FillCursorP; - else // Rect - return (isBlackBG) ? ToolCursor::FillCursorRWhite - : ToolCursor::FillCursorR; - } + int ret; + if (m_colorType.getValue() == LINES) + ret = ToolCursor::FillCursorL; + else { + ret = ToolCursor::FillCursor; + if (m_colorType.getValue() == AREAS) ret = ret | ToolCursor::Ex_Area; + } + if (m_fillType.getValue() == FREEHANDFILL) + ret = ret | ToolCursor::Ex_FreeHand; + else if (m_fillType.getValue() == POLYLINEFILL) + ret = ret | ToolCursor::Ex_PolyLine; + else if (m_fillType.getValue() == RECTFILL) + ret = ret | ToolCursor::Ex_Rectangle; + + if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg) + ret = ret | ToolCursor::Ex_Negate; + return ret; } //----------------------------------------------------------------------------- diff --git a/toonz/sources/tnztools/rastererasertool.cpp b/toonz/sources/tnztools/rastererasertool.cpp index 9cedad2..264a896 100644 --- a/toonz/sources/tnztools/rastererasertool.cpp +++ b/toonz/sources/tnztools/rastererasertool.cpp @@ -690,12 +690,28 @@ void EraserTool::draw() { //---------------------------------------------------------------------- int EraserTool::getCursorId() const { + int ret; if (m_eraseType.getValue() == NORMALERASE) - return ToolCursor::NormalEraserCursor; - else if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg) - return ToolCursor::RectEraserCursorWhite; - else - return ToolCursor::RectEraserCursor; + ret = ToolCursor::NormalEraserCursor; + else { + ret = ToolCursor::RectEraserCursor; + + if (m_eraseType.getValue() == FREEHANDERASE) + ret = ret | ToolCursor::Ex_FreeHand; + else if (m_eraseType.getValue() == POLYLINEERASE) + ret = ret | ToolCursor::Ex_PolyLine; + else if (m_eraseType.getValue() == RECTERASE) + ret = ret | ToolCursor::Ex_Rectangle; + } + + if (m_colorType.getValue() == LINES) + ret = ret | ToolCursor::Ex_Line; + else if (m_colorType.getValue() == AREAS) + ret = ret | ToolCursor::Ex_Area; + + if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg) + ret = ret | ToolCursor::Ex_Negate; + return ret; } //---------------------------------------------------------------------- diff --git a/toonz/sources/tnztools/rastertapetool.cpp b/toonz/sources/tnztools/rastertapetool.cpp index 0f927ce..e39992b 100644 --- a/toonz/sources/tnztools/rastertapetool.cpp +++ b/toonz/sources/tnztools/rastertapetool.cpp @@ -671,10 +671,19 @@ public: //---------------------------------------------------------------------- int getCursorId() const override { + int ret = ToolCursor::TapeCursor; + + if (m_closeType.getValue() == FREEHAND_CLOSE) + ret = ret | ToolCursor::Ex_FreeHand; + else if (m_closeType.getValue() == POLYLINE_CLOSE) + ret = ret | ToolCursor::Ex_PolyLine; + else if (m_closeType.getValue() == RECT_CLOSE) + ret = ret | ToolCursor::Ex_Rectangle; + if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg) - return ToolCursor::TapeCursorWhite; - else - return ToolCursor::TapeCursor; + ret = ret | ToolCursor::Ex_Negate; + + return ret; } //---------------------------------------------------------------------- diff --git a/toonz/sources/tnztools/stylepickertool.cpp b/toonz/sources/tnztools/stylepickertool.cpp index 29a81a0..663b347 100644 --- a/toonz/sources/tnztools/stylepickertool.cpp +++ b/toonz/sources/tnztools/stylepickertool.cpp @@ -212,22 +212,20 @@ void StylePickerTool::mouseMove(const TPointD &pos, const TMouseEvent &e) { } int StylePickerTool::getCursorId() const { - bool isBlackBG = ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg; - + int ret; /* in case the "organize palette" option is active */ if (m_organizePalette.getValue()) - return (isBlackBG) ? ToolCursor::PickerCursorWhiteOrganize - : ToolCursor::PickerCursorOrganize; - - if (m_colorType.getValue() == LINES) - return (isBlackBG) ? ToolCursor::PickerCursorWhiteLine - : ToolCursor::PickerCursorLine; + ret = ToolCursor::PickerCursorOrganize; + else if (m_colorType.getValue() == LINES) + ret = ToolCursor::PickerCursorLine; else if (m_colorType.getValue() == AREAS) - return (isBlackBG) ? ToolCursor::PickerCursorWhiteArea - : ToolCursor::PickerCursorArea; + ret = ToolCursor::PickerCursorArea; else // line&areas - return (isBlackBG) ? ToolCursor::PickerCursorWhite - : ToolCursor::PickerCursor; + ret = ToolCursor::PickerCursor; + + if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg) + ret = ret | ToolCursor::Ex_Negate; + return ret; } bool StylePickerTool::onPropertyChanged(std::string propertyName) { diff --git a/toonz/sources/tnztools/tnztools.qrc b/toonz/sources/tnztools/tnztools.qrc index 1b5b91b..154613d 100644 --- a/toonz/sources/tnztools/tnztools.qrc +++ b/toonz/sources/tnztools/tnztools.qrc @@ -44,39 +44,16 @@ Resources/scale_hv.png Resources/normaleraser.png Resources/recteraser.png - Resources/recteraser_white.png - Resources/fill_white.png - Resources/tape_white.png - Resources/picker_style_white_line.png - Resources/picker_style_white_area.png - Resources/picker_style_white.png Resources/picker_style_organize.png - Resources/picker_style_white_organize.png Resources/picker_rgb.png - Resources/picker_rgb_white.png - Resources/fill_f.png - Resources/fill_f_white.png - Resources/fill_p.png - Resources/fill_p_white.png - Resources/fill_r.png - Resources/fill_r_white.png - Resources/fill_a.png - Resources/fill_a_white.png - Resources/fill_a_f.png - Resources/fill_a_f_white.png - Resources/fill_a_p.png - Resources/fill_a_p_white.png - Resources/fill_a_r.png - Resources/fill_a_r_white.png + Resources/picker_rgb_white.png Resources/karasu.png - Resources/karasu_white.png - Resources/karasu_f.png - Resources/karasu_f_white.png - Resources/karasu_p.png - Resources/karasu_p_white.png - Resources/karasu_r.png - Resources/karasu_r_white.png Resources/ruler_modify.png Resources/ruler_new.png + Resources/ex_freehand.png + Resources/ex_polyline.png + Resources/ex_rectangle.png + Resources/ex_line.png + Resources/ex_area.png \ No newline at end of file diff --git a/toonz/sources/tnztools/vectortapetool.cpp b/toonz/sources/tnztools/vectortapetool.cpp index 0bcba57..5869536 100644 --- a/toonz/sources/tnztools/vectortapetool.cpp +++ b/toonz/sources/tnztools/vectortapetool.cpp @@ -752,10 +752,11 @@ public: } int getCursorId() const override { + int ret = ToolCursor::TapeCursor; + if (m_type.getValue() == RECT) ret = ret | ToolCursor::Ex_Rectangle; if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg) - return ToolCursor::TapeCursorWhite; - else - return ToolCursor::TapeCursor; + ret = ret | ToolCursor::Ex_Negate; + return ret; } } vectorTapeTool;