small fixes

This commit is contained in:
Stepets 2014-10-25 22:58:36 +04:00
parent 90483c8833
commit 3e41d97521
2 changed files with 46 additions and 42 deletions

View File

@ -157,9 +157,11 @@ function newobject:update(dt)
if self.bartype == "vertical" then
self.height = self.parent.height
self.staticx = self.parent.width - self.width
if parent.hbar then self.height = self.height - parent:GetHorizontalScrollBody().height end
elseif self.bartype == "horizontal" then
self.width = self.parent.width
self.staticy = self.parent.height - self.height
if parent.vbar then self.width = self.width - parent:GetVerticalScrollBody().width end
end
end

View File

@ -938,8 +938,9 @@ function newobject:UpdateIndicator()
end
-- indicator should be visible, so correcting scrolls
if self.focus then
local indicatorRelativeX = width + self.textoffsetx - self.offsetx
local leftlimit, rightlimit = 0, self:GetWidth()
local leftlimit, rightlimit = 25, self:GetWidth() - 25
if self.linenumberspanel then
leftlimit = leftlimit + self:GetLineNumbersPanel().width
end
@ -970,7 +971,7 @@ function newobject:UpdateIndicator()
end
end
local indicatorRelativeY = (line - 1) * theight + self.textoffsety - self.offsety
local uplimit, downlimit = 0, self:GetHeight()
local uplimit, downlimit = 25, self:GetHeight() - 25
if self.hbar then
downlimit = downlimit - self:GetHorizontalScrollBody().height
end
@ -984,6 +985,7 @@ function newobject:UpdateIndicator()
vbody:GetScrollBar():ScrollTo((line - 1 + correction)/#lines)
end
end
end
return self