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.
Files changed (2) hide show
  1. package/components/Card.js +11 -9
  2. package/package.json +1 -1
@@ -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
- x: child.x - this.x,
63
- y: child.y - this.y
60
+ x: relativeX,
61
+ y: relativeY
64
62
  });
65
63
 
66
- // Si autoLayout est activé, organiser automatiquement
64
+ // CONVERTIR seulement si autoLayout est activé
67
65
  if (this.autoLayout) {
68
- this.layout();
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvasframework",
3
- "version": "0.5.31",
3
+ "version": "0.5.32",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/beyons/CanvasFramework.git"