Skip to content

Commit 62e950d

Browse files
committed
feat: 补回shift+点点儿涂鸦上色的功能
1 parent cdbc430 commit 62e950d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/src/core/service/controlService/controller/concrete/ControllerPenStrokeDrawing.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Settings } from "@/core/service/Settings";
44
import { PenStroke, PenStrokeSegment } from "@/core/stage/stageObject/entity/PenStroke";
55
import { TextNode } from "@/core/stage/stageObject/entity/TextNode";
66
import { isMac } from "@/utils/platform";
7-
import { Color, Vector } from "@graphif/data-structures";
7+
import { Color, mixColors, Vector } from "@graphif/data-structures";
88
import { toast } from "sonner";
99

1010
/**
@@ -68,7 +68,12 @@ export class ControllerPenStrokeDrawingClass extends ControllerClass {
6868
const entity = this.project.stageManager.findEntityByLocation(releaseWorldLocation);
6969
if (entity) {
7070
if (entity instanceof TextNode) {
71-
entity.color = this.getCurrentStrokeColor().clone();
71+
if (this.project.controller.pressingKeySet.has("shift")) {
72+
const entityColor = entity.color.clone();
73+
entity.color = mixColors(entityColor, this.getCurrentStrokeColor().clone(), 0.1);
74+
} else {
75+
entity.color = this.getCurrentStrokeColor().clone();
76+
}
7277
}
7378
}
7479
this.releaseMouseAndClear();

0 commit comments

Comments
 (0)