canvasframework 0.5.3 → 0.5.4
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/Tabs.js +32 -24
- package/index.js +1 -1
- package/package.json +1 -1
package/components/Tabs.js
CHANGED
|
@@ -363,30 +363,38 @@ class Tabs extends Component {
|
|
|
363
363
|
ctx.restore();
|
|
364
364
|
|
|
365
365
|
// ===== DESSINER LES ENFANTS DU TAB ACTIF =====
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
366
|
+
// ===== DESSINER LES ENFANTS DU TAB ACTIF =====
|
|
367
|
+
const activeChildren = this.getActiveChildren();
|
|
368
|
+
const scrollOffset = this.framework.scrollOffset || 0;
|
|
369
|
+
|
|
370
|
+
ctx.save();
|
|
371
|
+
|
|
372
|
+
// ✅ clip de la zone de contenu
|
|
373
|
+
ctx.beginPath();
|
|
374
|
+
ctx.rect(this.x, this.contentY, this.width, this.contentHeight);
|
|
375
|
+
ctx.clip();
|
|
376
|
+
|
|
377
|
+
for (let child of activeChildren) {
|
|
378
|
+
if (!child.visible) continue;
|
|
379
|
+
|
|
380
|
+
ctx.save();
|
|
381
|
+
|
|
382
|
+
const originalX = child.x;
|
|
383
|
+
const originalY = child.y;
|
|
384
|
+
|
|
385
|
+
// ✅ appliquer le scroll
|
|
386
|
+
child.x = this.x + originalX;
|
|
387
|
+
child.y = this.contentY + originalY - scrollOffset;
|
|
388
|
+
|
|
389
|
+
child.draw(ctx);
|
|
390
|
+
|
|
391
|
+
child.x = originalX;
|
|
392
|
+
child.y = originalY;
|
|
393
|
+
|
|
394
|
+
ctx.restore();
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
ctx.restore();
|
|
390
398
|
}
|
|
391
399
|
|
|
392
400
|
drawRipples(ctx, tabWidth) {
|
package/index.js
CHANGED