From ad19e740ba3c3cbb59999b0b53a79f1b529a731b Mon Sep 17 00:00:00 2001 From: kramm Date: Sat, 24 Nov 2007 19:50:35 +0000 Subject: [PATCH] patch from Vladimir Dzhuvinov to add possible pin parameters --- src/swfc.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 13 deletions(-) diff --git a/src/swfc.c b/src/swfc.c index 317133d..1875129 100644 --- a/src/swfc.c +++ b/src/swfc.c @@ -2676,29 +2676,71 @@ SPOINT getPoint(SRECT r, char*name) { int l=0; if(!strcmp(name, "center")) { - SPOINT p; - p.x = (r.xmin + r.xmax)/2; - p.y = (r.ymin + r.ymax)/2; - return p; - } - if (!strcmp(name, "bottom-center")) - { - SPOINT p; - p.x = (r.xmin + r.xmax)/2; - p.y = r.ymax; - return p; + SPOINT p; + p.x = (r.xmin + r.xmax)/2; + p.y = (r.ymin + r.ymax)/2; + return p; + } + if (!strcmp(name, "bottom-center")) { + SPOINT p; + p.x = (r.xmin + r.xmax)/2; + p.y = r.ymax; + return p; + } + if (!strcmp(name, "top-center")) { + SPOINT p; + p.x = (r.xmin + r.xmax)/2; + p.y = r.ymin; + return p; + } + if (!strcmp(name, "top-left")) { + SPOINT p; + p.x = r.xmin; + p.y = r.ymin; + return p; + } + if (!strcmp(name, "top-right")) { + SPOINT p; + p.x = r.xmax; + p.y = r.ymin; + return p; + } + if (!strcmp(name, "bottom-right")) { + SPOINT p; + p.x = r.xmax; + p.y = r.ymax; + return p; + } + if (!strcmp(name, "bottom-left")) { + SPOINT p; + p.x = r.xmin; + p.y = r.ymax; + return p; + } + if (!strcmp(name, "left-center")) { + SPOINT p; + p.x = r.xmin; + p.y = (r.ymin + r.ymax)/2; + return p; + } + if (!strcmp(name, "right-center")) { + SPOINT p; + p.x = r.xmax; + p.y = (r.ymin + r.ymax)/2; + return p; } if(points_initialized) - l = (int)dictionary_lookup(&points, name); + l = (int)dictionary_lookup(&points, name); if(l==0) { - syntaxerror("Invalid point: \"%s\".", name); + syntaxerror("Invalid point: \"%s\".", name); } l--; return *(SPOINT*)&mpoints.buffer[l]; } + static int texture2(char*name, char*object, map_t*args, int errors) { SPOINT pos,size; -- 1.7.10.4