Canvas theme moved to net objects

This commit is contained in:
Yousef Khadadeh 2025-12-16 23:06:46 +03:00
parent 86858d238e
commit 0b67c9cc46
18 changed files with 164 additions and 112 deletions

View file

@ -183,7 +183,7 @@ bool BrushTool::prevent_undo_or_redo() {
void BrushTool::draw(SkCanvas* canvas, const DrawData& drawData) {
if(!drawData.main->toolbar.io->hoverObstructed) {
SkPaint linePaint;
linePaint.setColor4f(drawP.world.canvasTheme.toolFrontColor);
linePaint.setColor4f(drawP.world.canvasTheme.get_tool_front_color());
linePaint.setStroke(true);
linePaint.setStrokeWidth(0.0f);
float width;

View file

@ -385,7 +385,7 @@ SkPaint DrawingProgram::select_tool_line_paint() {
SkPaint selectLinePaint;
selectLinePaint.setStyle(SkPaint::kStroke_Style);
selectLinePaint.setStrokeWidth(3);
selectLinePaint.setColor4f(world.canvasTheme.toolFrontColor);
selectLinePaint.setColor4f(world.canvasTheme.get_tool_front_color());
selectLinePaint.setPathEffect(lassoLineDashEffect);
return selectLinePaint;

View file

@ -84,7 +84,7 @@ bool EraserTool::prevent_undo_or_redo() {
void EraserTool::draw(SkCanvas* canvas, const DrawData& drawData) {
if(!drawData.main->toolbar.io->hoverObstructed) {
SkColor4f c = drawP.world.canvasTheme.toolFrontColor;
SkColor4f c = drawP.world.canvasTheme.get_tool_front_color();
c.fA = 0.5f;
SkPaint linePaint;

View file

@ -163,7 +163,7 @@ void GridModifyTool::draw(SkCanvas* canvas, const DrawData& drawData) {
Vector2f bMin = drawP.world.drawData.cam.c.to_space(b.min);
Vector2f bMax = drawP.world.drawData.cam.c.to_space(b.max);
SkPaint rectBoundsPaint;
rectBoundsPaint.setColor4f(drawP.world.canvasTheme.toolFrontColor);
rectBoundsPaint.setColor4f(drawP.world.canvasTheme.get_tool_front_color());
rectBoundsPaint.setStroke(true);
rectBoundsPaint.setStrokeWidth(0.0f);
canvas->drawRect(SkRect::MakeLTRB(bMin.x(), bMin.y(), bMax.x(), bMax.y()), rectBoundsPaint);