Add support for custom anchors for PNGs and SVGs #392
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thesvg
andpng
dsl methods).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...
_samples
?In fact I updated the
samples/images/_images.rb
sample to add an example of images rotating around different anchorsdocs/
folder?I have written basic unit tests to check the
anchor:
argument validationI 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...
anchor:
fortext
or other methods. (I updated the ScaleBox class which is only used bysvg
andpng
)