Skip to content

Conversation

@Amit-Matth
Copy link
Contributor

@Amit-Matth Amit-Matth commented Jan 19, 2026

Added a callback mechanism to CanvasStateProvider to reset canvas zoom and position when creating a new image. The canvas now properly resets to default zoom level (0.85) and centered position instead of persisting the previous image's view state.

PAINTROID-514

New Features and Enhancements

  • Canvas zoom and position now reset to default when creating a new image

Refactorings and Bug Fixes

  • Fixed: Canvas zoom level and position persistence issue when creating new images
  • Added resetCanvasScaleCallback to CanvasStateProvider
  • Modified IOHandler.newImage() to trigger canvas scale reset
  • Registered reset callback in DrawingCanvas.initState()

Implementation based on closed PR #21

Checklist

Your checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Add the link to the ticket in Jira in the description of the PR
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines (Wiki)
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Add new information to the Wiki

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.

1 participant