editor fix, camera confined to level

This commit is contained in:
lustlion
2022-01-31 07:38:15 +01:00
parent bb53c2787b
commit 486f242544
3 changed files with 10 additions and 27 deletions

View File

@@ -127,23 +127,10 @@ function EditorDoEdit()
elseif Keybind:HasPressed(Keybind.generic.lshift) then
LevelExpandCanvas(math.sign(expand_h),math.sign(expand_v))
if expand_h < 0 then
Camera.pos.x = Camera.pos.x - math.sign(expand_h)*tileProperties.scale*tileProperties.width
end
if expand_v < 0 then
Camera.pos.y = Camera.pos.y - math.sign(expand_v)*tileProperties.scale*tileProperties.height
end
LevelReloadTiles()
elseif Keybind:HasPressed(Keybind.generic.lctrl) then
LevelReduceCanvas(math.sign(expand_h),math.sign(expand_v))
if expand_h < 0 then
Camera.pos.x = Camera.pos.x - math.sign(expand_h)*tileProperties.scale*tileProperties.width
end
if expand_v < 0 then
Camera.pos.y = Camera.pos.y - math.sign(expand_v)*tileProperties.scale*tileProperties.height
end
LevelReloadTiles()
end
end
end