Skip to content

Commit dc96b88

Browse files
committed
💄 优化显示效果
1 parent 005028e commit dc96b88

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

app/src/core/render/canvas2d/renderer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { CopyEngine } from "../../service/dataManageService/copyEngine/copyEngin
1111
import { StageStyleManager } from "../../service/feedbackService/stageStyle/StageStyleManager";
1212
import { Camera } from "../../stage/Camera";
1313
import { Canvas } from "../../stage/Canvas";
14-
import { Stage } from "../../stage/Stage";
14+
import { LeftMouseModeEnum, Stage } from "../../stage/Stage";
1515
import { StageHistoryManager } from "../../stage/stageManager/StageHistoryManager";
1616
import { StageManager } from "../../stage/stageManager/StageManager";
1717
import { StageObject } from "../../stage/stageObject/abstract/StageObject";
@@ -493,7 +493,7 @@ export namespace Renderer {
493493
function renderTempDrawing() {
494494
const currentStrokeColor = Stage.drawingMachine.getCurrentStrokeColor();
495495

496-
if (Stage.drawingMachine.isUsing) {
496+
if (Stage.leftMouseMode === LeftMouseModeEnum.draw) {
497497
if (Stage.drawingControlMachine.isAdjusting) {
498498
ShapeRenderer.renderCircle(
499499
transformWorld2View(Stage.drawingControlMachine.startAdjustWidthLocation),

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ export class ControllerPenStrokeControl extends ControllerClass {
4646
}
4747
};
4848

49+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
50+
public mouseup: (event: MouseEvent) => void = (_event) => {
51+
if (Stage.leftMouseMode === LeftMouseModeEnum.draw) {
52+
if (this.isAdjusting) {
53+
this.isAdjusting = false;
54+
}
55+
}
56+
};
57+
4958
private onMouseMoveWhenAdjusting = (event: MouseEvent) => {
5059
// 更改宽度,检测鼠标上下移动的距离(模仿PS的笔刷粗细调整)
5160
const worldLocation = Renderer.transformView2World(new Vector(event.clientX, event.clientY));

app/src/pages/_toolbar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { save as saveFileDialog } from "@tauri-apps/plugin-dialog";
22

33
import {
44
BrainCircuit,
5-
Brush,
65
ClipboardPaste,
76
ClipboardX,
87
Globe,
@@ -11,6 +10,7 @@ import {
1110
Package,
1211
PaintBucket,
1312
Palette,
13+
Pencil,
1414
RefreshCcw,
1515
Repeat,
1616
SaveAll,
@@ -58,7 +58,7 @@ export function ToolbarItem({ icon, handleFunction, description, isHighlight = f
5858
<span className="bg-toolbar-tooltip-bg border-toolbar-tooltip-border text-toolbar-tooltip-text pointer-events-none absolute bottom-8 z-10 w-auto origin-right scale-90 whitespace-nowrap rounded border p-1 text-xs opacity-0 group-hover:scale-100 group-hover:opacity-100">
5959
{description}
6060
</span>
61-
{isHighlight && <div className="bg-panel-success-text absolute bottom-0 h-1 w-6 rounded-t-md" />}
61+
{isHighlight && <div className="bg-panel-success-text absolute top-0 h-1 w-6 rounded-b-md" />}
6262
</div>
6363
);
6464
}
@@ -229,7 +229,7 @@ export default function Toolbar({ className = "" }: { className?: string }) {
229229
/>
230230
<ToolbarItem
231231
description="左键:涂鸦模式"
232-
icon={<Brush className="rotate-90" />}
232+
icon={<Pencil className="rotate-90" />}
233233
handleFunction={() => {
234234
Stage.drawingMachine.open();
235235
Stage.leftMouseMode = LeftMouseModeEnum.draw;
@@ -240,7 +240,7 @@ export default function Toolbar({ className = "" }: { className?: string }) {
240240
isHighlight={isDrawing}
241241
/>
242242
<ToolbarItem
243-
description="左键:连接与断开(正在开发中,先用右键)"
243+
description="左键:连接与斩断"
244244
icon={<Slash className="rotate-90" />}
245245
handleFunction={() => {
246246
Stage.drawingMachine.open();

0 commit comments

Comments
 (0)