diff options
author | Sebastian Geerken <devnull@localhost> | 2015-09-18 13:10:21 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-09-18 13:10:21 +0200 |
commit | 00019c419b796e2ca924e505ca0e9e2eaeeeef1a (patch) | |
tree | 4417075b0aff15b7f231553a14390a7a57c5505e | |
parent | 7fcad302075d564e7df6d2c53d20b7f9e03da69f (diff) |
Fix SizeParams::forChild.
-rw-r--r-- | dw/tools.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/dw/tools.cc b/dw/tools.cc index 65734900..df52ae1d 100644 --- a/dw/tools.cc +++ b/dw/tools.cc @@ -73,20 +73,21 @@ void SizeParams::forChild (Widget *parent, Widget *child, int xRel, int yRel, for (int i = 0; i < numChildReferences; i++) { Widget *childReference = child->sizeRequestReference (i); + if (childReference == parent) { - childParams->references[numPos] = childReference; - childParams->x[numPos] = xRel; - childParams->y[numPos] = yRel; - numPos++; + childParams->references[childParams->numPos] = childReference; + childParams->x[childParams->numPos] = xRel; + childParams->y[childParams->numPos] = yRel; + childParams->numPos++; } else { bool found = false; for (int j = 0; !found && j < numPos; j++) { if (childReference == references[j]) { found = true; - references[numPos] = childReference; - childParams->x[numPos] = x[j] + xRel; - childParams->y[numPos] = y[j] + yRel; - numPos++; + childParams->references[childParams->numPos] = childReference; + childParams->x[childParams->numPos] = x[j] + xRel; + childParams->y[childParams->numPos] = y[j] + yRel; + childParams->numPos++; } } } |