mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-20 14:43:27 +02:00
Updated to OTCv8 3.1 rev 190
This commit is contained in:
@@ -144,16 +144,19 @@ function UIScrollArea:onMouseWheel(mousePos, mouseWheel)
|
||||
return true
|
||||
end
|
||||
|
||||
function UIScrollArea:ensureChildVisible(child)
|
||||
function UIScrollArea:ensureChildVisible(child, offset)
|
||||
if child then
|
||||
local paddingRect = self:getPaddingRect()
|
||||
if not offset then
|
||||
offset = {x = 0, y = 0}
|
||||
end
|
||||
if self.verticalScrollBar then
|
||||
local deltaY = paddingRect.y - child:getY()
|
||||
if deltaY > 0 then
|
||||
self.verticalScrollBar:decrement(deltaY)
|
||||
end
|
||||
|
||||
deltaY = (child:getY() + child:getHeight()) - (paddingRect.y + paddingRect.height)
|
||||
deltaY = (child:getY() + child:getHeight() + offset.y) - (paddingRect.y + paddingRect.height)
|
||||
if deltaY > 0 then
|
||||
self.verticalScrollBar:increment(deltaY)
|
||||
end
|
||||
@@ -163,7 +166,7 @@ function UIScrollArea:ensureChildVisible(child)
|
||||
self.horizontalScrollBar:decrement(deltaX)
|
||||
end
|
||||
|
||||
deltaX = (child:getX() + child:getWidth()) - (paddingRect.x + paddingRect.width)
|
||||
deltaX = (child:getX() + child:getWidth() + offset.x) - (paddingRect.x + paddingRect.width)
|
||||
if deltaX > 0 then
|
||||
self.horizontalScrollBar:increment(deltaX)
|
||||
end
|
||||
|
Reference in New Issue
Block a user