File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/editor/core/draw/graffiti Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,11 @@ export class Graffiti {
3030 if ( ! this . draw . isGraffitiMode ( ) ) return
3131 this . isDrawing = true
3232 // 缓存起始数据
33+ const { scale } = this . options
3334 this . startStroke = {
3435 lineColor : this . options . graffiti . defaultLineColor ,
3536 lineWidth : this . options . graffiti . defaultLineWidth ,
36- points : [ evt . offsetX , evt . offsetY ]
37+ points : [ evt . offsetX / scale , evt . offsetY / scale ]
3738 }
3839 }
3940
@@ -69,9 +70,10 @@ export class Graffiti {
6970 this . startStroke = null
7071 }
7172 if ( ! currentValue ?. strokes ?. length ) return
73+ const { scale } = this . options
7274 const lastPoints =
7375 currentValue . strokes [ currentValue . strokes . length - 1 ] . points
74- lastPoints . push ( offsetX , offsetY )
76+ lastPoints . push ( offsetX / scale , offsetY / scale )
7577 // 重新渲染
7678 this . draw . render ( {
7779 isCompute : false ,
You can’t perform that action at this time.
0 commit comments