feat: zoom-bucket text sharpness + remove fontSize toolbar controls

Add TextSharpnessManager for crisp text rendering at all zoom levels:
- Discrete zoom buckets (0.5–3x) avoid texture churn on small zoom changes
- Initial bucket applied to all items on setup and newly created items
  via SceneManager.onItemCreated callback (fixes blurry-on-load)
- Visibility check uses getItemWorldBounds for correct grouped item coords
- TextSprite/StickySprite gain setZoomBucket() for resolution control

Remove fontSize +/- controls from contextual toolbar — font size is now
controlled purely through direct manipulation (resize → bake).
This commit is contained in:
Hiren Kangad
2026-03-12 23:23:30 +05:30
parent 9fac16e6a4
commit 1ac727ea60
7 changed files with 177 additions and 57 deletions
@@ -49,6 +49,7 @@ export class StickySprite extends Container {
// Background redraw cache: skip Graphics.clear()+redraw when shape is unchanged
private _bgCacheKey = '';
private _zoomBucket = 1;
/** After layout, the computed card height. Parent should sync to data.h. */
get computedHeight(): number {
@@ -60,6 +61,16 @@ export class StickySprite extends Container {
this._text.visible = visible;
}
/**
* Update text rasterization resolution for zoom-bucket crisp rendering.
* Only re-rasterizes when the bucket actually changes.
*/
setZoomBucket(bucket: number): void {
if (bucket === this._zoomBucket) return;
this._zoomBucket = bucket;
this._text.resolution = bucket;
}
constructor(data: StickyObject) {
super();