aboutsummaryrefslogtreecommitdiff
path: root/generic/tkZinc.c
diff options
context:
space:
mode:
authorlecoanet2004-09-09 08:08:54 +0000
committerlecoanet2004-09-09 08:08:54 +0000
commit43b699a331e50f5e89d1aa6580bf807c0997f474 (patch)
treeae25c42115cea34de000673bed59692dbafd5a31 /generic/tkZinc.c
parent072fb1a5170e6c5a94664c465fa626d4ee62f74e (diff)
downloadtkzinc-43b699a331e50f5e89d1aa6580bf807c0997f474.zip
tkzinc-43b699a331e50f5e89d1aa6580bf807c0997f474.tar.gz
tkzinc-43b699a331e50f5e89d1aa6580bf807c0997f474.tar.bz2
tkzinc-43b699a331e50f5e89d1aa6580bf807c0997f474.tar.xz
Fixed a bug in the parsing of find enclosed/overlapping arguments.
The recursive flag was mixed with the inGroup argument. Added a test to the bbox method argument parsing to trap permutation of options (-label -field) and tagOrId specifications.
Diffstat (limited to 'generic/tkZinc.c')
-rw-r--r--generic/tkZinc.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/generic/tkZinc.c b/generic/tkZinc.c
index 0e4d878..c9bb082 100644
--- a/generic/tkZinc.c
+++ b/generic/tkZinc.c
@@ -3251,7 +3251,7 @@ FindItems(ZnWInfo *wi,
}
ps.recursive = True;
ps.override_atomic = False;
- if (argc > first+5) {
+ if (argc > first+6) {
result = Tcl_GetBooleanFromObj(wi->interp, args[first+6], &ps.recursive);
if (result != TCL_OK) {
str = Tcl_GetString(args[first+6]);
@@ -3288,7 +3288,7 @@ FindItems(ZnWInfo *wi,
}
ps.recursive = True;
ps.override_atomic = False;
- if (argc > first+5) {
+ if (argc > first+6) {
result = Tcl_GetBooleanFromObj(wi->interp, args[first+6], &ps.recursive);
if (result != TCL_OK) {
str = Tcl_GetString(args[first+6]);
@@ -4280,16 +4280,26 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
}
else {
ZnFIELD.GetLabelBBox(fs, &width, &height);
- p.x = ZnNearestInt(fs->label_pos.x);
- p.y = ZnNearestInt(fs->label_pos.y);
- ZnAddPointToBBox(&bbox, p.x, p.y);
- p.x += width;
- p.y += height;
- ZnAddPointToBBox(&bbox, p.x, p.y);
+ if (width && height) {
+ p.x = ZnNearestInt(fs->label_pos.x);
+ p.y = ZnNearestInt(fs->label_pos.y);
+ ZnAddPointToBBox(&bbox, p.x, p.y);
+ p.x += width;
+ p.y += height;
+ ZnAddPointToBBox(&bbox, p.x, p.y);
+ }
}
}
else {
for (i = 0; i < (unsigned int) argc; i++) {
+ /*
+ * Check for options in wrong place amidst tags.
+ */
+ str = Tcl_GetString(args[i]);
+ if (*str == '-') {
+ Tcl_AppendResult(interp, "bbox options should be specified before any tag", NULL);
+ goto error;
+ }
if (ZnTagSearchScan(wi, args[i], &search_var) == TCL_ERROR) {
goto error;
}