Skip to content

Commit

Permalink
refactor: remove check before adding 0.5 to cursor position (#770)
Browse files Browse the repository at this point in the history
math.huge + 0.5 == math.huge
  • Loading branch information
christoph-heinrich authored Nov 5, 2023
1 parent 650118e commit a7ee37c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/uosc/lib/cursor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ function cursor:move(x, y)
end

-- Add 0.5 to be in the middle of the pixel
self.x = x == math.huge and x or x + 0.5
self.y = y == math.huge and y or y + 0.5
self.x, self.y = x + 0.5, y + 0.5

if old_x ~= self.x or old_y ~= self.y then
if self.x == math.huge or self.y == math.huge then
Expand Down

0 comments on commit a7ee37c

Please sign in to comment.