feat: board thumbnails, inline rename, UX overhaul + zoom/counter fixes
- Auto-generate board thumbnail from canvas content on save (webp, 400px) - Collection cards show stacked/fanned board thumbnails with random offsets - Three-dot menu on all cards with Rename, Share, Delete actions - Inline rename for collections (header + card) and boards - Collection cards show public/private status and member count - Share button on collection cards for quick access - Add updateCollection/updateBoard API functions - Add thumbnail + object_count columns to boards table with migration - Fix zoom drift: use element-relative coords (offsetX/Y) not getScenePoint - Fix thumbnail generation breaking viewport: use finally block for restore - Fix thumbnail bounds: use scene-space obj coords not screen-space getBoundingRect - Fix object counter: live count from canvas instead of stale DB images table - Fix three-dot menu clipping by removing overflow:hidden from card containers - Status bar shows "objects" instead of "images", updates on add/delete
This commit is contained in:
@@ -138,9 +138,9 @@ const FabricCanvas = forwardRef<FabricCanvasHandle, FabricCanvasProps>(
|
||||
zoom *= 1 - direction * ZOOM_STEP;
|
||||
zoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, zoom));
|
||||
|
||||
// Zoom toward cursor position (industry standard)
|
||||
const point = canvas.getScenePoint(e);
|
||||
canvas.zoomToPoint(point, zoom);
|
||||
// Zoom toward cursor — must use element-relative coords (offsetX/Y),
|
||||
// NOT getScenePoint() which returns scene-space and causes zoom drift
|
||||
canvas.zoomToPoint({ x: e.offsetX, y: e.offsetY } as any, zoom);
|
||||
canvas.requestRenderAll();
|
||||
persistViewport();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user