Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使某个文本块(不是整个文档)“具有左侧填充”。我可以说:
text_box "some text", :at => [200, 100]
但这不是我要寻找的,因为它指定 x 和 y 作为填充,而我只想指定 x。
我怎么做?
你可以这样做:
indent(10, 15) do # left and right padding text "Some text" end
我现在无法测试它,但你可以尝试这样的事情:
text_box "some text", :at => [200, cursor]
其中 cursor 是一个返回cursory 位置的方法。
cursor
我希望它有所帮助。