cursor customize
|
@ -60,42 +60,12 @@ enum {
|
||||||
|
|
||||||
NormalEraserCursor,
|
NormalEraserCursor,
|
||||||
RectEraserCursor,
|
RectEraserCursor,
|
||||||
RectEraserCursorWhite,
|
|
||||||
FillCursorWhite,
|
|
||||||
TapeCursorWhite,
|
|
||||||
PickerCursorWhite,
|
|
||||||
PickerCursorWhiteLine,
|
|
||||||
PickerCursorWhiteArea,
|
|
||||||
PickerCursorOrganize,
|
PickerCursorOrganize,
|
||||||
PickerCursorWhiteOrganize,
|
|
||||||
|
|
||||||
PickerRGB,
|
PickerRGB,
|
||||||
PickerRGBWhite,
|
PickerRGBWhite,
|
||||||
|
|
||||||
FillCursorF,
|
|
||||||
FillCursorFWhite,
|
|
||||||
FillCursorP,
|
|
||||||
FillCursorPWhite,
|
|
||||||
FillCursorR,
|
|
||||||
FillCursorRWhite,
|
|
||||||
|
|
||||||
FillCursorA,
|
|
||||||
FillCursorAWhite,
|
|
||||||
FillCursorAF,
|
|
||||||
FillCursorAFWhite,
|
|
||||||
FillCursorAP,
|
|
||||||
FillCursorAPWhite,
|
|
||||||
FillCursorAR,
|
|
||||||
FillCursorARWhite,
|
|
||||||
|
|
||||||
FillCursorL,
|
FillCursorL,
|
||||||
FillCursorLWhite,
|
|
||||||
FillCursorLF,
|
|
||||||
FillCursorLFWhite,
|
|
||||||
FillCursorLP,
|
|
||||||
FillCursorLPWhite,
|
|
||||||
FillCursorLR,
|
|
||||||
FillCursorLRWhite,
|
|
||||||
|
|
||||||
MoveEWCursor,
|
MoveEWCursor,
|
||||||
MoveNSCursor,
|
MoveNSCursor,
|
||||||
|
@ -105,7 +75,15 @@ enum {
|
||||||
ScaleHVCursor,
|
ScaleHVCursor,
|
||||||
FxGadgetCursor,
|
FxGadgetCursor,
|
||||||
RulerModifyCursor,
|
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
|
} // namespace
|
||||||
|
|
BIN
toonz/sources/tnztools/Resources/ex_area.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
toonz/sources/tnztools/Resources/ex_freehand.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
toonz/sources/tnztools/Resources/ex_line.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
toonz/sources/tnztools/Resources/ex_polyline.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
toonz/sources/tnztools/Resources/ex_rectangle.png
Normal file
After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 467 B |
Before Width: | Height: | Size: 506 B |
Before Width: | Height: | Size: 538 B |
Before Width: | Height: | Size: 509 B |
Before Width: | Height: | Size: 538 B |
Before Width: | Height: | Size: 509 B |
Before Width: | Height: | Size: 535 B |
Before Width: | Height: | Size: 490 B |
Before Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 512 B |
Before Width: | Height: | Size: 487 B |
Before Width: | Height: | Size: 514 B |
Before Width: | Height: | Size: 486 B |
Before Width: | Height: | Size: 511 B |
Before Width: | Height: | Size: 416 B |
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 338 B |
Before Width: | Height: | Size: 355 B |
Before Width: | Height: | Size: 340 B |
Before Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 345 B |
Before Width: | Height: | Size: 360 B |
Before Width: | Height: | Size: 341 B |
Before Width: | Height: | Size: 304 B After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 335 B |
Before Width: | Height: | Size: 332 B |
Before Width: | Height: | Size: 326 B |
Before Width: | Height: | Size: 299 B |
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 310 B |
Before Width: | Height: | Size: 444 B After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 555 B |
|
@ -9,6 +9,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -22,7 +23,7 @@ const struct {
|
||||||
{ToolCursor::CutterCursor, "cutter", 6, 24}, // 12,20},
|
{ToolCursor::CutterCursor, "cutter", 6, 24}, // 12,20},
|
||||||
{ToolCursor::EraserCursor, "eraser", 7, 21}, // 15,16},
|
{ToolCursor::EraserCursor, "eraser", 7, 21}, // 15,16},
|
||||||
{ToolCursor::DistortCursor, "selection_distort", 11, 6},
|
{ToolCursor::DistortCursor, "selection_distort", 11, 6},
|
||||||
{ToolCursor::FillCursor, "fill", 6, 23},
|
{ToolCursor::FillCursor, "fill", 3, 26},
|
||||||
{ToolCursor::MoveCursor, "move", 15, 15},
|
{ToolCursor::MoveCursor, "move", 15, 15},
|
||||||
{ToolCursor::MoveEWCursor, "move_ew", 15, 15},
|
{ToolCursor::MoveEWCursor, "move_ew", 15, 15},
|
||||||
{ToolCursor::MoveNSCursor, "move_ns", 15, 15},
|
{ToolCursor::MoveNSCursor, "move_ns", 15, 15},
|
||||||
|
@ -54,7 +55,7 @@ const struct {
|
||||||
{ToolCursor::ScaleGlobalCursor, "scale_global", 15, 15},
|
{ToolCursor::ScaleGlobalCursor, "scale_global", 15, 15},
|
||||||
{ToolCursor::ScaleHVCursor, "scale_hv", 15, 15},
|
{ToolCursor::ScaleHVCursor, "scale_hv", 15, 15},
|
||||||
{ToolCursor::StrokeSelectCursor, "stroke_select", 11, 6},
|
{ToolCursor::StrokeSelectCursor, "stroke_select", 11, 6},
|
||||||
{ToolCursor::TapeCursor, "tape", 9, 23},
|
{ToolCursor::TapeCursor, "tape", 4, 23},
|
||||||
{ToolCursor::TrackerCursor, "tracker", 12, 15},
|
{ToolCursor::TrackerCursor, "tracker", 12, 15},
|
||||||
{ToolCursor::TypeInCursor, "type_in", 16, 19},
|
{ToolCursor::TypeInCursor, "type_in", 16, 19},
|
||||||
{ToolCursor::TypeOutCursor, "type_out", 16, 19},
|
{ToolCursor::TypeOutCursor, "type_out", 16, 19},
|
||||||
|
@ -65,41 +66,12 @@ const struct {
|
||||||
{ToolCursor::SplineEditorCursor, "stroke_select", 11, 6},
|
{ToolCursor::SplineEditorCursor, "stroke_select", 11, 6},
|
||||||
{ToolCursor::SplineEditorCursorAdd, "selection_add", 11, 6},
|
{ToolCursor::SplineEditorCursorAdd, "selection_add", 11, 6},
|
||||||
{ToolCursor::SplineEditorCursorSelect, "selection_convert", 11, 6},
|
{ToolCursor::SplineEditorCursorSelect, "selection_convert", 11, 6},
|
||||||
{ToolCursor::NormalEraserCursor, "normaleraser", 10, 21},
|
{ToolCursor::NormalEraserCursor, "normaleraser", 3, 26},
|
||||||
{ToolCursor::RectEraserCursor, "recteraser", 10, 21},
|
{ToolCursor::RectEraserCursor, "recteraser", 3, 26},
|
||||||
{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::PickerCursorOrganize, "picker_style_organize", 7, 22},
|
{ToolCursor::PickerCursorOrganize, "picker_style_organize", 7, 22},
|
||||||
{ToolCursor::PickerCursorWhiteOrganize, "picker_style_white_organize", 7,
|
|
||||||
22},
|
|
||||||
{ToolCursor::PickerRGB, "picker_rgb", 7, 22},
|
{ToolCursor::PickerRGB, "picker_rgb", 7, 22},
|
||||||
{ToolCursor::PickerRGBWhite, "picker_rgb_white", 7, 22},
|
{ToolCursor::PickerRGBWhite, "picker_rgb_white", 7, 22},
|
||||||
{ToolCursor::FillCursorF, "fill_f", 6, 23},
|
{ToolCursor::FillCursorL, "karasu", 7, 25},
|
||||||
{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::RulerModifyCursor, "ruler_modify", 7, 7},
|
{ToolCursor::RulerModifyCursor, "ruler_modify", 7, 7},
|
||||||
{ToolCursor::RulerNewCursor, "ruler_new", 7, 7},
|
{ToolCursor::RulerNewCursor, "ruler_new", 7, 7},
|
||||||
{0, 0, 0, 0}};
|
{0, 0, 0, 0}};
|
||||||
|
@ -108,6 +80,16 @@ struct CursorData {
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
int x, y;
|
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;
|
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) {
|
const CursorData &getCursorData(int cursorType) {
|
||||||
// se e' gia' in tabella lo restituisco
|
// se e' gia' in tabella lo restituisco
|
||||||
std::map<int, CursorData>::iterator it;
|
std::map<int, CursorData>::iterator it;
|
||||||
it = m_cursors.find(cursorType);
|
it = m_cursors.find(cursorType);
|
||||||
if (it != m_cursors.end()) return it->second;
|
if (it != m_cursors.end()) return it->second;
|
||||||
|
|
||||||
|
int decorationsFlag = cursorType & ~(0xFF);
|
||||||
|
int baseCursorType = cursorType & 0xFF;
|
||||||
|
|
||||||
// provo a cercarlo in cursorInfo[]
|
// provo a cercarlo in cursorInfo[]
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; cursorInfo[i].pixmapFilename; i++)
|
for (i = 0; cursorInfo[i].pixmapFilename; i++)
|
||||||
if (cursorType == cursorInfo[i].cursorType) {
|
if (baseCursorType == cursorInfo[i].cursorType) {
|
||||||
QString path =
|
QString path =
|
||||||
QString(":Resources/") + cursorInfo[i].pixmapFilename + ".png";
|
QString(":Resources/") + cursorInfo[i].pixmapFilename + ".png";
|
||||||
CursorData data;
|
CursorData data;
|
||||||
data.pixmap = QPixmap(path);
|
data.pixmap = QPixmap(path);
|
||||||
data.x = cursorInfo[i].x;
|
if (decorationsFlag != 0) doDecoration(data.pixmap, decorationsFlag);
|
||||||
data.y = cursorInfo[i].y;
|
data.x = cursorInfo[i].x;
|
||||||
it = m_cursors.insert(std::make_pair(cursorType, data)).first;
|
data.y = cursorInfo[i].y;
|
||||||
|
it = m_cursors.insert(std::make_pair(cursorType, data)).first;
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
// niente da fare. uso un default
|
// niente da fare. uso un default
|
||||||
|
|
|
@ -1775,48 +1775,23 @@ FillTool::FillTool(int targetType)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
int FillTool::getCursorId() const {
|
int FillTool::getCursorId() const {
|
||||||
bool isBlackBG = ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg;
|
int ret;
|
||||||
|
if (m_colorType.getValue() == LINES)
|
||||||
if (m_colorType.getValue() == LINES) {
|
ret = ToolCursor::FillCursorL;
|
||||||
if (m_fillType.getValue() == NORMALFILL)
|
else {
|
||||||
return (isBlackBG) ? ToolCursor::FillCursorLWhite
|
ret = ToolCursor::FillCursor;
|
||||||
: ToolCursor::FillCursorL;
|
if (m_colorType.getValue() == AREAS) ret = ret | ToolCursor::Ex_Area;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
@ -690,12 +690,28 @@ void EraserTool::draw() {
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
int EraserTool::getCursorId() const {
|
int EraserTool::getCursorId() const {
|
||||||
|
int ret;
|
||||||
if (m_eraseType.getValue() == NORMALERASE)
|
if (m_eraseType.getValue() == NORMALERASE)
|
||||||
return ToolCursor::NormalEraserCursor;
|
ret = ToolCursor::NormalEraserCursor;
|
||||||
else if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg)
|
else {
|
||||||
return ToolCursor::RectEraserCursorWhite;
|
ret = ToolCursor::RectEraserCursor;
|
||||||
else
|
|
||||||
return 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -671,10 +671,19 @@ public:
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
int getCursorId() const override {
|
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)
|
if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg)
|
||||||
return ToolCursor::TapeCursorWhite;
|
ret = ret | ToolCursor::Ex_Negate;
|
||||||
else
|
|
||||||
return ToolCursor::TapeCursor;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -212,22 +212,20 @@ void StylePickerTool::mouseMove(const TPointD &pos, const TMouseEvent &e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int StylePickerTool::getCursorId() const {
|
int StylePickerTool::getCursorId() const {
|
||||||
bool isBlackBG = ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg;
|
int ret;
|
||||||
|
|
||||||
/* in case the "organize palette" option is active */
|
/* in case the "organize palette" option is active */
|
||||||
if (m_organizePalette.getValue())
|
if (m_organizePalette.getValue())
|
||||||
return (isBlackBG) ? ToolCursor::PickerCursorWhiteOrganize
|
ret = ToolCursor::PickerCursorOrganize;
|
||||||
: ToolCursor::PickerCursorOrganize;
|
else if (m_colorType.getValue() == LINES)
|
||||||
|
ret = ToolCursor::PickerCursorLine;
|
||||||
if (m_colorType.getValue() == LINES)
|
|
||||||
return (isBlackBG) ? ToolCursor::PickerCursorWhiteLine
|
|
||||||
: ToolCursor::PickerCursorLine;
|
|
||||||
else if (m_colorType.getValue() == AREAS)
|
else if (m_colorType.getValue() == AREAS)
|
||||||
return (isBlackBG) ? ToolCursor::PickerCursorWhiteArea
|
ret = ToolCursor::PickerCursorArea;
|
||||||
: ToolCursor::PickerCursorArea;
|
|
||||||
else // line&areas
|
else // line&areas
|
||||||
return (isBlackBG) ? ToolCursor::PickerCursorWhite
|
ret = ToolCursor::PickerCursor;
|
||||||
: ToolCursor::PickerCursor;
|
|
||||||
|
if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg)
|
||||||
|
ret = ret | ToolCursor::Ex_Negate;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StylePickerTool::onPropertyChanged(std::string propertyName) {
|
bool StylePickerTool::onPropertyChanged(std::string propertyName) {
|
||||||
|
|
|
@ -44,39 +44,16 @@
|
||||||
<file>Resources/scale_hv.png</file>
|
<file>Resources/scale_hv.png</file>
|
||||||
<file>Resources/normaleraser.png</file>
|
<file>Resources/normaleraser.png</file>
|
||||||
<file>Resources/recteraser.png</file>
|
<file>Resources/recteraser.png</file>
|
||||||
<file>Resources/recteraser_white.png</file>
|
|
||||||
<file>Resources/fill_white.png</file>
|
|
||||||
<file>Resources/tape_white.png</file>
|
|
||||||
<file>Resources/picker_style_white_line.png</file>
|
|
||||||
<file>Resources/picker_style_white_area.png</file>
|
|
||||||
<file>Resources/picker_style_white.png</file>
|
|
||||||
<file>Resources/picker_style_organize.png</file>
|
<file>Resources/picker_style_organize.png</file>
|
||||||
<file>Resources/picker_style_white_organize.png</file>
|
|
||||||
<file>Resources/picker_rgb.png</file>
|
<file>Resources/picker_rgb.png</file>
|
||||||
<file>Resources/picker_rgb_white.png</file>
|
<file>Resources/picker_rgb_white.png</file>
|
||||||
<file>Resources/fill_f.png</file>
|
|
||||||
<file>Resources/fill_f_white.png</file>
|
|
||||||
<file>Resources/fill_p.png</file>
|
|
||||||
<file>Resources/fill_p_white.png</file>
|
|
||||||
<file>Resources/fill_r.png</file>
|
|
||||||
<file>Resources/fill_r_white.png</file>
|
|
||||||
<file>Resources/fill_a.png</file>
|
|
||||||
<file>Resources/fill_a_white.png</file>
|
|
||||||
<file>Resources/fill_a_f.png</file>
|
|
||||||
<file>Resources/fill_a_f_white.png</file>
|
|
||||||
<file>Resources/fill_a_p.png</file>
|
|
||||||
<file>Resources/fill_a_p_white.png</file>
|
|
||||||
<file>Resources/fill_a_r.png</file>
|
|
||||||
<file>Resources/fill_a_r_white.png</file>
|
|
||||||
<file>Resources/karasu.png</file>
|
<file>Resources/karasu.png</file>
|
||||||
<file>Resources/karasu_white.png</file>
|
|
||||||
<file>Resources/karasu_f.png</file>
|
|
||||||
<file>Resources/karasu_f_white.png</file>
|
|
||||||
<file>Resources/karasu_p.png</file>
|
|
||||||
<file>Resources/karasu_p_white.png</file>
|
|
||||||
<file>Resources/karasu_r.png</file>
|
|
||||||
<file>Resources/karasu_r_white.png</file>
|
|
||||||
<file>Resources/ruler_modify.png</file>
|
<file>Resources/ruler_modify.png</file>
|
||||||
<file>Resources/ruler_new.png</file>
|
<file>Resources/ruler_new.png</file>
|
||||||
|
<file>Resources/ex_freehand.png</file>
|
||||||
|
<file>Resources/ex_polyline.png</file>
|
||||||
|
<file>Resources/ex_rectangle.png</file>
|
||||||
|
<file>Resources/ex_line.png</file>
|
||||||
|
<file>Resources/ex_area.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
|
@ -752,10 +752,11 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int getCursorId() const override {
|
int getCursorId() const override {
|
||||||
|
int ret = ToolCursor::TapeCursor;
|
||||||
|
if (m_type.getValue() == RECT) ret = ret | ToolCursor::Ex_Rectangle;
|
||||||
if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg)
|
if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg)
|
||||||
return ToolCursor::TapeCursorWhite;
|
ret = ret | ToolCursor::Ex_Negate;
|
||||||
else
|
return ret;
|
||||||
return ToolCursor::TapeCursor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} vectorTapeTool;
|
} vectorTapeTool;
|
||||||
|
|