Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale and center SVG in the editor #14178

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

kevintab95
Copy link
Member

Overview

  1. This PR fixes or fixes part of #[NA].
  2. This PR does the following: This PR fixes an issue that caused SVG images to look smaller when trying to edit them.

Essential Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The linter/Karma presubmit checks have passed locally on your machine.
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)
    • This lets reviewers restart your CircleCI tests for you.
  • The PR is made from a branch that's not called "develop".

Proof that changes are correct

svg-edit-resize.mp4

PR Pointers

  • Make sure to follow the instructions for making a code change.
  • Oppiabot will notify you when you don't add a PR_CHANGELOG label. If you are unable to do so, please @-mention a code owner (who will be in the Reviewers list), or ask on Gitter.
  • For what code owners will expect, see the Code Owner's wiki page.
  • Make sure your PR follows conventions in the style guide, otherwise this will lead to review delays.
  • Never force push. If you do, your PR will be closed.
  • Oppiabot can assign anyone for review/help if you leave a comment like the following: "{{Question/comment}} @{{reviewer_username}} PTAL"
  • Some of the e2e tests are flaky, and can fail for reasons unrelated to your PR. We are working on fixing this, but in the meantime, if you need to restart the tests, please check the "If your build fails" wiki page.

@oppiabot
Copy link

oppiabot bot commented Nov 4, 2021

Hi, @kevintab95, this pull request does not have a "CHANGELOG: ..." label as mentioned in the PR pointers. Assigning @kevintab95 to add the required label. PRs without this label will not be merged. If you are unsure of which label to add, please ask the reviewers for guidance. Thanks!

@kevintab95
Copy link
Member Author

Hi @vojtechjelinek @iamprayush could you please prioritise this? We're trying to hotfix this PR. Thanks!

Comment on lines +1608 to +1611
let dimensions = this.value && (
this.imagePreloaderService.getDimensionsOfImage(this.value));
this.canvas.setHeight(dimensions?.height || this.CANVAS_HEIGHT);
this.canvas.setWidth(dimensions?.width || this.CANVAS_WIDTH);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused by this code, but I think it can be addressed in subsequent PR.

I think that we should have an explanatory comment here. Also I'm unsure what let dimensions = this.value && this.imagePreloaderService.getDimensionsOfImage(this.value); does?

Copy link
Member

@vojtechjelinek vojtechjelinek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment that should be addressed in a different PR.

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.

None yet

3 participants