Record this as a known issue and point to the bug
parent
50ddf0f576
commit
188112d581
|
|
@ -111,14 +111,11 @@ module Squib
|
||||||
iter = layout.iter
|
iter = layout.iter
|
||||||
while iter.next_char! && iter.index < index; end
|
while iter.next_char! && iter.index < index; end
|
||||||
letter_width = iter.char_extents.width - spacing # the width of our inserted space char
|
letter_width = iter.char_extents.width - spacing # the width of our inserted space char
|
||||||
para_x = case layout.alignment
|
case layout.alignment
|
||||||
when Pango::Layout::Alignment::CENTER
|
when Pango::Layout::Alignment::CENTER,
|
||||||
(layout.width - iter.line_extents[0].width) / 2
|
Pango::Layout::Alignment::RIGHT
|
||||||
when Pango::Layout::Alignment::RIGHT
|
Squib.logger.warn "Center- or right-aligned text do not always embed properly. This is a known issue with a workaround. See https://github.com/andymeneely/squib/issues/46"
|
||||||
layout.width - iter.line_extents[0].width
|
end
|
||||||
else
|
|
||||||
0
|
|
||||||
end
|
|
||||||
x = Pango.pixels(rect.x + (letter_width / 2))
|
x = Pango.pixels(rect.x + (letter_width / 2))
|
||||||
y = Pango.pixels(rect.y)
|
y = Pango.pixels(rect.y)
|
||||||
svg(rule[:file], rule[:id], x, y, rule[:width], rule[:height],
|
svg(rule[:file], rule[:id], x, y, rule[:width], rule[:height],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue