[tekui-devel] tekui: Rect is now initialized with -1, layout probed with rect[...
Timm S. Mueller
tmueller at neoscientists.org
Fri Apr 11 00:30:25 CEST 2008
details: http://hg.teklib.org/tekui/rev/42299fbdbcaa
changeset: 417:42299fbdbcaa
user: Timm S. Mueller <tmueller at neoscientists.org>
date: Thu Apr 10 07:44:51 2008 +0200
description:
Rect is now initialized with -1, layout probed with rect[1] >= 0
diffs (36 lines):
diff -r 96bd978241ce -r 42299fbdbcaa tek/class/ui/area.lua
--- a/tek/class/ui/area.lua Wed Apr 09 23:41:07 2008 +0200
+++ b/tek/class/ui/area.lua Thu Apr 10 07:44:51 2008 +0200
@@ -57,7 +57,7 @@ function Area.new(class, self)
-- Calculated minimum/maximum sizes of the element:
self.MinMax = { 0, 0, 0, 0 }
-- The layouted rectangle of the element on the display:
- self.Rect = { 0, 0, 0, 0 }
+ self.Rect = { -1, -1, -1, -1 }
return Element.new(class, self)
end
diff -r 96bd978241ce -r 42299fbdbcaa tek/class/ui/scrollgroup.lua
--- a/tek/class/ui/scrollgroup.lua Wed Apr 09 23:41:07 2008 +0200
+++ b/tek/class/ui/scrollgroup.lua Thu Apr 10 07:44:51 2008 +0200
@@ -334,7 +334,7 @@ function ScrollGroup:setWidth(w)
w = w or ca.Width
ca.Width = w
local r = ca.Rect
- if r and r[1] then
+ if r[1] >= 0 then
local sw = w > 0 and (r[3] - r[1] + 1) * 0x10000 / w or 0x10000
if self:enableHSlider(self.HSliderMode == "on"
or self.HSliderMode == "auto" and sw < 0x10000) then
diff -r 96bd978241ce -r 42299fbdbcaa tek/class/ui/slider.lua
--- a/tek/class/ui/slider.lua Wed Apr 09 23:41:07 2008 +0200
+++ b/tek/class/ui/slider.lua Thu Apr 10 07:44:51 2008 +0200
@@ -138,7 +138,7 @@ function Slider:getKnobRect()
function Slider:getKnobRect()
local r = self.Rect
- if r[1] then -- TODO
+ if r[1] >= 0 then
local p = self.PaddingAndBorder
local m = self.Knob.MarginAndBorder
local pos = self.Position
More information about the tekui-devel
mailing list