我试图将一些内容垂直居中放置在bounding_box中.使用单个文本,这没有问题:
bounding_box([0, bounds.top], :width => pdf.bounds.right, :height => pdf.bounds.top) do
text "vertically aligned in the surrounding box", :valign => :center
end
Run Code Online (Sandbox Code Playgroud)
但是如果我的边界框中有多个元素,我该怎么办:
bounding_box([0, bounds.top], :width => pdf.bounds.right, :height => pdf.bounds.top) do
text "vertically aligned in the surrounding box", :valign => :center
text "vertically aligned in the surrounding box", :valign => :center
end
Run Code Online (Sandbox Code Playgroud)
这不起作用,当你尝试这个时,文本被重叠......
我正在寻找一种方法来分组bounding_box的整个内容,然后垂直对齐整个组.有没有办法用大虾做这个?
非常感谢你的帮助!克里斯
我想在我的rails应用程序中创建一个路径来处理gps坐标参数.目的是找到给定位置附近的餐馆.
这是我开始的:
match "/restaurants/near/:lat/:lng(/:range)", :to => "restaurants#near", :as => "near", :constraints => {:range => /\d+/}
似乎路由器有浮动参数的问题,像/restaurants/near/53.0123/10.5678这样的网址无法识别.您是否有处理铁路网址中GPS坐标的解决方案或最佳实践?
谢谢!