Curl
 

Menu
 Chapter.1
 Chapter.2
 Chapter.3
 Chapter.4
 Chapter.5
 Chapter.6
 Chapter.7
 Chapter.8
 Chapter.9
 Chapter.10
 
 
■Fillの概要

相対的な埋め込み処理が必要な場合には、Fillクラスを使用します。
Fillは、状況に応じて伸長する1単位分の間隔を作成します。

【Fillによる相対的な埋め込み】

{curl 6.0 applet}
{curl-file-attributes character-encoding = "shift-jis"}
{HBox width=10cm,
{Fill background="wheat"},
{RegularPolygonGraphic sides=8, width=1cm, height=1cm},
{Fill background="wheat"},
{Fill background="wheat"},
{RegularPolygonGraphic sides=8, width=1cm, height=1cm},
{Fill background="wheat"},
{Fill background="wheat"},
{Fill background="wheat"},
{RegularPolygonGraphic sides=8, width=1cm, height=1cm},
{Fill background="wheat"}
}
|| 1cm単位で交互に色が変わるルーラーを描きます。
{HBox
{Fill background="blue", height=3mm, width=1cm},
{Fill background="red", height=3mm, width=1cm},
{Fill background="blue", height=3mm, width=1cm},
{Fill background="red", height=3mm, width=1cm},
{Fill background="blue", height=3mm, width=1cm},
{Fill background="red", height=3mm, width=1cm},
{Fill background="blue", height=3mm, width=1cm},
{Fill background="red", height=3mm, width=1cm},
{Fill background="blue", height=3mm, width=1cm},
{Fill background="red", height=3mm, width=1cm}
}



下部のルーラーを基準にして確認すると、それぞれのFillオブジェクトが相対的に1単位分の間隔(この例の場合には1cm)を正確に占めていることがわかります。なお、この例で1cmという切りの良い数になっているのは、10cmの領域に意図的に10個のオブジェクトを挿入したためです。
例えば、もし領域が8cmだとしたら、 Fill オブジェクト1つ分の間隔は(8cm−八角形3個分の3cm)÷(7個のFill オブジェクト)=0.71428.....cmになります。この間隔では視覚的に正確なサイズを確認するのが困難になるでしょう。


Chapter.9(Part.4)へ戻る
Chapter.10(Part.1)へ進む