Skip to content

Implement canvas fitting on new scene creation - #736

Closed
everctba wants to merge 1 commit into
friction2d:mainfrom
everctba:main
Closed

Implement canvas fitting on new scene creation#736
everctba wants to merge 1 commit into
friction2d:mainfrom
everctba:main

Conversation

@everctba

Copy link
Copy Markdown

Added “Fit to Canvas” (Ctrl + 0) function to automatically center and scale the artboard when creating a new scene.

2026-04-19 00_30_31-Window When creating a new file (for example, 1220×1080), the artboard is not centered on the canvas, unlike the default 1920×1080 size, which initializes already centered.

Added “Fit to Canvas” (Ctrl + 0) function to automatically center and scale the artboard when creating a new scene.

When creating a new file (for example, 1220×1080), the artboard is not centered on the canvas, unlike the default 1920×1080 size, which initializes already centered.
@pgilfernandez

Copy link
Copy Markdown

Nice! simple but very useful, thanks!

@rodlie

rodlie commented Aug 14, 2026

Copy link
Copy Markdown
Member

Sorry for not responding on this PR. life, work etc....

I will not merge this, you include CanvasWindow from the app into the ui lib.

@rodlie

rodlie commented Aug 14, 2026

Copy link
Copy Markdown
Member

btw, what is the problem? fitCanvasToSize already runs on new scene and when you switch scene.

friction-2026-08-14_12.27.55.mp4

@rodlie rodlie closed this Aug 14, 2026
@pgilfernandez

Copy link
Copy Markdown

btw, what is the problem? fitCanvasToSize already runs on new scene and when you switch scene.

In macOS, when creating a new project after startup Friction, it doesn't fit to canvas...

I thought that was the PR about

@rodlie

rodlie commented Aug 14, 2026

Copy link
Copy Markdown
Member

btw, what is the problem? fitCanvasToSize already runs on new scene and when you switch scene.

In macOS, when creating a new project after startup Friction, it doesn't fit to canvas...

I thought that was the PR about

Ok, is this a new issue? (or something that happens on macOS 26+?) Been on Linux for several months. Will power up my old macbook and check.

@pgilfernandez

Copy link
Copy Markdown

I always use my oldish MacBook Pro with Monterey and it doesn't fit to canvas on new project creation where the first scene is created, I can't confirm you if this also happens when creating subsequent ones... I'll be able ti confirm late today

@rodlie

rodlie commented Aug 14, 2026

Copy link
Copy Markdown
Member

Thanks for the info, I will look at the issue (on macOS 12/15) a bit later today, currently trying to fix a different issue.

@rodlie

rodlie commented Aug 14, 2026

Copy link
Copy Markdown
Member

I can confirm the issue in macOS, but the code works, fitCanvas run as on Linux, but we have yet another "magic" bug on macOS that does everything it should but nothing happens. Getting tired of stupid macOS bugs, it's like putting on a bandaid after your foot got amputated or something. I also don't like to add workarounds when the problem is much deeper, what else don't work as it should?

but whatever, I dont care anymore, see workaround: #808

@rodlie

rodlie commented Aug 14, 2026

Copy link
Copy Markdown
Member

Fix merged into main.

Thanks @everctba for highlighting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants