fix possible mapview crash

This commit is contained in:
Eduardo Bart
2012-03-28 16:09:45 -03:00
parent 4743763d48
commit a4cef0d390
6 changed files with 87 additions and 55 deletions

View File

@@ -10,6 +10,7 @@ end
function UIResizeBorder:onHoverChange(hovered)
if hovered then
if g_ui.getDraggingWidget() then return end
if self:getWidth() > self:getHeight() then
Mouse.setVerticalCursor()
self.vertical = true
@@ -17,13 +18,15 @@ function UIResizeBorder:onHoverChange(hovered)
Mouse.setHorizontalCursor()
self.vertical = false
end
self.hovering = true
if not self:isPressed() then
Effects.fadeIn(self)
end
else
if not self:isPressed() then
if not self:isPressed() and self.hovering then
Mouse.restoreCursor()
Effects.fadeOut(self)
self.hovering = false
end
end
end
@@ -63,6 +66,7 @@ function UIResizeBorder:onMouseRelease(mousePos, mouseButton)
if not self:isHovered() then
Mouse.restoreCursor()
Effects.fadeOut(self)
self.hovering = false
end
end

View File

@@ -73,3 +73,6 @@ function UIMiniWindow:onMinimize()
end
end
function UIMiniWindow:getClassName()
return 'UIMiniWindow'
end

View File

@@ -8,8 +8,10 @@ function UIMiniWindowContainer.create()
end
function UIMiniWindowContainer:onDrop(widget, mousePos)
widget:setParent(self)
return true
if widget:getClassName() == 'UIMiniWindow' then
widget:setParent(self)
return true
end
end
function UIMiniWindowContainer:getClassName()