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

Embedded icon alignment not as expected #348

Open
adsilcott opened this issue Oct 27, 2021 · 2 comments
Open

Embedded icon alignment not as expected #348

adsilcott opened this issue Oct 27, 2021 · 2 comments
Labels

Comments

@adsilcott
Copy link

Squib's embedded icons feature is one of my favorite things about it! However, I've encountered an alignment issue in a specific circumstance. Either I'm doing something wrong or it's a bug.

Here is my code:

text str: data.buy, layout: :buy do |embed|
    embed.svg key: '[coin]', file: 'img/coin.svg', layout: :embedded
    embed.svg key: '[gem]',  file: 'img/gem.svg',  layout: :embedded
end

with the layout:

buy:
  extends: name
  x: 468
  y: 637
  width: 506
  height: 75
  align: right

embedded:
  height: 75
  width: 75
  align: center
  valign: middle

with the result:
SquibExample001

Looks great!

However, when I change the code to add some text to the string:
text str: data.buy.map{ |s| if (s != nil) then s = "Cost: " + s end }, layout: :buy do |embed|

here is the result:
SquibExample002

Now the text is perfectly aligned, but the icons have dropped down a bit. Is the the correct behavior?

@adsilcott adsilcott added the bug label Oct 27, 2021
@andymeneely
Copy link
Owner

Ah, embedding. My albatross. Have you tried dx and dy to nudge the icons? That's how I fix it.

I have very little control over where it draws and I can't explain how it decides sometimes.

@adsilcott
Copy link
Author

That fixed it, thanks! I wasn't aware of dx and dy--I should have read the text documentation a little more thoroughly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants