Fixed gutter text jittering when horizontal scrolling on docview
This commit is contained in:
parent
9bf0ed2419
commit
bcd1b3a081
|
@ -211,6 +211,7 @@ function CommandView:draw_line_gutter(idx, x, y)
|
||||||
local pos = self.position
|
local pos = self.position
|
||||||
local color = common.lerp(style.text, style.accent, self.gutter_text_brightness / 100)
|
local color = common.lerp(style.text, style.accent, self.gutter_text_brightness / 100)
|
||||||
core.push_clip_rect(pos.x, pos.y, self:get_gutter_width(), self.size.y)
|
core.push_clip_rect(pos.x, pos.y, self:get_gutter_width(), self.size.y)
|
||||||
|
x = x + style.padding.x
|
||||||
renderer.draw_text(self:get_font(), self.label, x, y + yoffset, color)
|
renderer.draw_text(self:get_font(), self.label, x, y + yoffset, color)
|
||||||
core.pop_clip_rect()
|
core.pop_clip_rect()
|
||||||
end
|
end
|
||||||
|
|
|
@ -330,7 +330,7 @@ function DocView:draw_line_gutter(idx, x, y)
|
||||||
color = style.line_number2
|
color = style.line_number2
|
||||||
end
|
end
|
||||||
local yoffset = self:get_line_text_y_offset()
|
local yoffset = self:get_line_text_y_offset()
|
||||||
x = x + self.scroll.x
|
x = style.padding.x
|
||||||
renderer.draw_text(self:get_font(), idx, x, y + yoffset, color)
|
renderer.draw_text(self:get_font(), idx, x, y + yoffset, color)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ function DocView:draw()
|
||||||
local lh = self:get_line_height()
|
local lh = self:get_line_height()
|
||||||
|
|
||||||
local _, y = self:get_line_screen_position(minline)
|
local _, y = self:get_line_screen_position(minline)
|
||||||
local x = self:get_content_offset() + style.padding.x
|
local x = self.position.x
|
||||||
for i = minline, maxline do
|
for i = minline, maxline do
|
||||||
self:draw_line_gutter(i, x, y)
|
self:draw_line_gutter(i, x, y)
|
||||||
y = y + lh
|
y = y + lh
|
||||||
|
|
Loading…
Reference in New Issue