Skip to content

Commit 49cb02e

Browse files
committed
修绘制控件时的坐标系会受到场景绘制影响,优化一点细节
1 parent 09470b3 commit 49cb02e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Zframework/widget.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ WIDGET.indexMeta={
13771377
function WIDGET.setWidgetList(list)
13781378
WIDGET.unFocus(true)
13791379
WIDGET.active=list or NONE
1380-
WIDGET.cursorMove(SCR.xOy:inverseTransformPoint(love.mouse.getPosition()))
1380+
WIDGET.cursorMove(xOy:inverseTransformPoint(love.mouse.getPosition()))
13811381

13821382
-- Reset all widgets
13831383
if list then
@@ -1519,6 +1519,7 @@ function WIDGET.resize(w,h)
15191519
widgetCanvas=gc.newCanvas(w,h)
15201520
end
15211521
function WIDGET.draw()
1522+
gc_replaceTransform(xOy)
15221523
gc_setCanvas({stencil=true},widgetCanvas)
15231524
gc_translate(0,-WIDGET.scrollPos)
15241525
for _,W in next,WIDGET.active do
@@ -1540,7 +1541,6 @@ function WIDGET.draw()
15401541
gc_setBlendMode('alpha','premultiplied')
15411542
gc_draw(widgetCanvas)
15421543
gc_setBlendMode('alpha')
1543-
gc_replaceTransform(SCR.xOy)
15441544
end
15451545

15461546
return WIDGET

0 commit comments

Comments
 (0)