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

Add support for custom anchors for PNGs and SVGs #392

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Ninjananas
Copy link

@Ninjananas Ninjananas commented Oct 28, 2024

Motivation

Hi Andy!

First of all, I'd like to thank you for Squib, it's a great tool that has been a HUGE help in my board game project.

As some people have pointed before in #356 and #238 for example, having more flexible ways to position images would be super cool, and I too need it for my project.

I have not implemented all the ideas in #238, I have only added an anchor: argument to the ScaleBox (which is used by the svg and png dsl methods).

rotated_anchors

I made sure that my changes are retro-compatible. Existing codebases should not be affected at all by these changes if they don't use the new features.

I have...

  • Written a sample in _samples?
    In fact I updated the samples/images/_images.rb sample to add an example of images rotating around different anchors
  • Updated documentation in the docs/ folder?
  • Linked this PR to an issue?
  • Written any automated tests?
    I have written basic unit tests to check the anchor: argument validation
  • Refactored your code to be maintainable?
    I tried to make minimal changes and follow the original programming style of the project, but I don't have much experience in Ruby so if you have any suggestions I'm eager to hear them!

I have not...

  • Written extensive tests, as I don't know how to write tests that check that the rendering is correct (I manually tested using sanity though)
  • Implemented anchor: for text or other methods. (I updated the ScaleBox class which is only used by svg and png)

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