summaryrefslogtreecommitdiff
path: root/src/ld-lua.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2010-12-10 08:57:42 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2010-12-10 08:57:42 +0100
commit37d898fb1a29f074747dbd9c81d6e2ad97d2e23e (patch)
tree1111ec9dccb2032df6bfc41b0985d606edd5ce70 /src/ld-lua.c
parent3d3a71d5d2be1bb14a71d03a2117eb2b317ef061 (diff)
downloadlogdiag-37d898fb1a29f074747dbd9c81d6e2ad97d2e23e.tar.gz
logdiag-37d898fb1a29f074747dbd9c81d6e2ad97d2e23e.tar.xz
logdiag-37d898fb1a29f074747dbd9c81d6e2ad97d2e23e.zip
Change LdSymbolArea members.
Now it contains coordinates of the top-left delimiting point and computed dimensions (instead of coorinates of both delimiting points).
Diffstat (limited to 'src/ld-lua.c')
-rw-r--r--src/ld-lua.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/ld-lua.c b/src/ld-lua.c
index 54ba0c4..4ed68eb 100644
--- a/src/ld-lua.c
+++ b/src/ld-lua.c
@@ -501,28 +501,35 @@ get_translation (lua_State *L, int index)
static gboolean
read_symbol_area (lua_State *L, int index, LdSymbolArea *area)
{
+ lua_Number x1, x2, y1, y2;
+
if (lua_objlen (L, index) != 4)
return FALSE;
lua_rawgeti (L, index, 1);
if (!lua_isnumber (L, -1))
return FALSE;
- area->x1 = lua_tonumber (L, -1);
+ x1 = lua_tonumber (L, -1);
lua_rawgeti (L, index, 2);
if (!lua_isnumber (L, -1))
return FALSE;
- area->y1 = lua_tonumber (L, -1);
+ y1 = lua_tonumber (L, -1);
lua_rawgeti (L, index, 3);
if (!lua_isnumber (L, -1))
return FALSE;
- area->x2 = lua_tonumber (L, -1);
+ x2 = lua_tonumber (L, -1);
lua_rawgeti (L, index, 4);
if (!lua_isnumber (L, -1))
return FALSE;
- area->y2 = lua_tonumber (L, -1);
+ y2 = lua_tonumber (L, -1);
+
+ area->x = MIN (x1, x2);
+ area->y = MIN (y1, y2);
+ area->width = ABS (x2 - x1);
+ area->height = ABS (y2 - y1);
return TRUE;
}