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

Allow for x-y coordinates to be negative and subtract from width-height #8

Closed
andymeneely opened this issue Jul 25, 2014 · 4 comments
Closed

Comments

@andymeneely
Copy link
Owner

Cairo doesn't do that normally. Maybe make this a configurable setting in config.yml so it's easier to place.

@andymeneely
Copy link
Owner Author

After playing around with this, I'm not sure I like it. I would rather run the layout.yml through ERB so we can do stuff like:

title:
  x: <%=@width-75%>

@scraimer
Copy link

Ooh, ERB for layouts would be awesome! It would move much of my positioning code out of the deck.rb and into the layout, where it belongs!

For example, If I want to draw a circle around some text. I could easily use ruby expressions to offset the circle so that its origin is positioned correctly to make the circle go around the text.

SomeText:
   x: 50
   y: 50
   width: 150
   height: 150

SomeTextCircle:
    x: <%=@x - 20%>
    y: <%=@y - 20%>

@andymeneely
Copy link
Owner Author

Actually, you don't need ERB for that situation - use extends:

SomeText:
  x: 50
  y: 50
SomeTextCircle:
  extends: SomeText
  x: -= 20 # in yaml this is a string, but it gets processed as a part of processing "extends"
  y: -= 20

http://andymeneely.github.io/squib/doc/file.README.html#Special_key__extends

But... there are other situations where ERB would be helpful. The issue I created for that is #36.

@scraimer
Copy link

Good point!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants