3

我想使某个文本块(不是整个文档)“具有左侧填充”。我可以说:

text_box "some text", :at => [200, 100]

但这不是我要寻找的,因为它指定 x 和 y 作为填充,而我只想指定 x。

我怎么做?

4

2 回答 2

5

你可以这样做:

indent(10, 15) do # left and right padding
  text "Some text"
end
于 2018-08-10T09:25:15.380 回答
2

我现在无法测试它,但你可以尝试这样的事情:

text_box "some text", :at => [200, cursor]

其中 cursor 是一个返回cursory 位置的方法。

我希望它有所帮助。

于 2013-09-30T09:18:10.950 回答