Skip to content

[Example] Setting opts in export-canvas-as-image #4534

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

Merged
merged 8 commits into from
Oct 3, 2024

Conversation

nayounsang
Copy link
Contributor

@nayounsang nayounsang commented Sep 17, 2024

  • I thought it would be nice to have an example that would allow users to experiment with the results depending on the option when exporting.
  • Rather than creating a new example, I added a feature to an existing example because it was appropriate.

Change type

  • bugfix
  • improvement
  • feature
  • api
  • other

Test plan

  • Unit tests
  • End to end tests

Release notes

  • I add new feature at export-canvas-as-image example.
    image
    image
  • It is possible to open and close. It was placed so as not to affect the existing layout and drawing as much as possible.
  • It can set opts: background, darkmode, padding, scale and Box's arg(x,y,w,h).
    • Background and darkmode are checkbox.
    • Padding, scale, box's arg are number input.
  • I accidentally manipulated the script in root's package.json, but it was restored to its original state. Because I didn't know there was a script to run the example.
  • Control component is implemented simply for DX.
  • ⚠️ I haven't implemented preserveAspectRatio yet. I will implement it if necessary.
  • ⚠️ If x, y, w, and h are only partially undefined in the box, no processing was performed. I thought it would be a good idea to check the results.

@huppy-bot huppy-bot bot added the feature New feature label Sep 17, 2024
Copy link

vercel bot commented Sep 17, 2024

@nayounsang is attempting to deploy a commit to the tldraw Team on Vercel.

A member of the Team first needs to authorize it.

@nayounsang nayounsang changed the title Export example [Example] Setting opts in export-canvas-as-image Sep 17, 2024
Copy link

vercel bot commented Oct 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
examples ✅ Ready (Inspect) Visit Preview Oct 3, 2024 8:03pm

@steveruizok
Copy link
Collaborator

Pushing some changes, then let's land this!

@steveruizok steveruizok added this pull request to the merge queue Oct 3, 2024
Merged via the queue into tldraw:main with commit 2f0bff1 Oct 3, 2024
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants