mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-21 20:52:12 -03:00
Refactor text rendering and adjust viewport defaults
Introduced a drawTextWithBackground helper to centralize and simplify text rendering with backgrounds in CanvasRenderer (JS/TS). Updated all relevant usages to use this helper. Adjusted initial viewport x/y offsets in Canvas and Canvas.ts for improved default positioning.
This commit is contained in:
@@ -50,8 +50,8 @@ export class Canvas {
|
||||
this.onHistoryChange = callbacks.onHistoryChange;
|
||||
this.lastMousePosition = { x: 0, y: 0 };
|
||||
this.viewport = {
|
||||
x: -(this.width / 4),
|
||||
y: -(this.height / 4),
|
||||
x: -(this.width / 1.5),
|
||||
y: -(this.height / 2),
|
||||
zoom: 0.8,
|
||||
};
|
||||
const { canvas: offscreenCanvas, ctx: offscreenCtx } = createCanvas(0, 0, '2d', {
|
||||
|
||||
Reference in New Issue
Block a user