canvasframework 0.5.31 → 0.5.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Card.js +11 -9
- package/package.json +1 -1
package/components/Card.js
CHANGED
|
@@ -52,20 +52,22 @@ class Card extends Component {
|
|
|
52
52
|
add(child) {
|
|
53
53
|
this.children.push(child);
|
|
54
54
|
|
|
55
|
-
// CONVERTIR les positions relatives en positions absolues
|
|
56
|
-
// Les x, y passés sont relatifs à la Card
|
|
57
|
-
child.x = this.x + child.x;
|
|
58
|
-
child.y = this.y + child.y;
|
|
59
|
-
|
|
60
55
|
// Stocker la position relative originale
|
|
56
|
+
const relativeX = child.x;
|
|
57
|
+
const relativeY = child.y;
|
|
58
|
+
|
|
61
59
|
this.childPositions.set(child, {
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
x: relativeX,
|
|
61
|
+
y: relativeY
|
|
64
62
|
});
|
|
65
63
|
|
|
66
|
-
//
|
|
64
|
+
// CONVERTIR seulement si autoLayout est activé
|
|
67
65
|
if (this.autoLayout) {
|
|
68
|
-
|
|
66
|
+
this.layout(); // layout() fera la conversion
|
|
67
|
+
} else {
|
|
68
|
+
// Si autoLayout est désactivé, convertir manuellement
|
|
69
|
+
child.x = this.x + relativeX;
|
|
70
|
+
child.y = this.y + relativeY;
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
return child;
|