I have not implemented all the ideas in https://github.com/andymeneely/squib/issues/238, I have only added an anchor: argument to the ScaleBox (which is used by the svg and png 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...
[x] 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
[x] Updated documentation in the docs/ folder?
[x] Linked this PR to an issue?
[x] Written any automated tests?
I have written basic unit tests to check the anchor: argument validation
[x] 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)
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 https://github.com/andymeneely/squib/discussions/356 and https://github.com/andymeneely/squib/issues/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 https://github.com/andymeneely/squib/issues/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 thesamples/images/_images.rb
sample to add an example of images rotating around different anchorsdocs/
folder?anchor:
argument validationI have not...
anchor:
fortext
or other methods. (I updated the ScaleBox class which is only used bysvg
andpng
)