Changed View:get_content_offset() to round resultant values

Avoids some issues that occur with fractional offsets, most noticable
on rectangles drawn on DocView jittering by 1-pixel when scrolling
This commit is contained in:
rxi 2020-04-30 14:40:26 +01:00
parent 2090379892
commit 4d39dcaded

View file

@ -111,7 +111,9 @@ end
function View:get_content_offset()
return self.position.x - self.scroll.x, self.position.y - self.scroll.y
local x = common.round(self.position.x - self.scroll.x)
local y = common.round(self.position.y - self.scroll.y)
return x, y
end