Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
cadin committed Feb 15, 2024
2 parents 80a499a + 004043b commit 3246fa4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Panels.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Panels version 1.7.2
-- Panels version 1.7.3
-- https://cadin.github.io/panels/

import "CoreLibs/object"
Expand Down
12 changes: 9 additions & 3 deletions modules/Panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,14 @@ function Panels.Panel.new(data)
end

if layer.pixelLock then
xPos = math.floor((xPos + offset.x) / layer.pixelLock) * layer.pixelLock - offset.x
yPos = math.floor((yPos + offset.y) / layer.pixelLock) * layer.pixelLock - offset.y
-- offset gets added here to ensure the layer position + offset gets rounded properly
-- then subtract the offset because it's applied at the panel level
local offX = math.floor(offset.x)
local offY = math.floor(offset.y)

xPos = math.floor((xPos + offX) / layer.pixelLock) * layer.pixelLock - offX
yPos = math.floor((yPos + offY) / layer.pixelLock) * layer.pixelLock - offY

end

if layer.effect then
Expand Down Expand Up @@ -735,7 +741,7 @@ function Panels.Panel.new(data)
self:updateFunction(offset)
end

gfx.setDrawOffset(offset.x + frame.x, offset.y + frame.y)
gfx.setDrawOffset(math.floor(offset.x + frame.x), math.floor(offset.y + frame.y))
gfx.setClipRect(0, 0, frame.width, frame.height)

if self.backgroundColor then gfx.clear(self.backgroundColor) end
Expand Down

0 comments on commit 3246fa4

Please sign in to comment.