コード例 #1
0
ファイル: StyleTest.php プロジェクト: AlexandreSGV/siteentec
 public function test_fromAttributes()
 {
     $style = new Style();
     $attributes = array("color" => "blue", "fill" => "#fff", "stroke" => "none");
     $style->fromAttributes($attributes);
     $this->assertEquals(array(0, 0, 255), $style->color);
     $this->assertEquals(array(255, 255, 255), $style->fill);
     $this->assertEquals("none", $style->stroke);
 }
コード例 #2
0
ファイル: Group.php プロジェクト: AlexandreSGV/siteentec
 protected function before($attribs)
 {
     $surface = $this->document->getSurface();
     $surface->save();
     $style = new Style();
     $style->inherit($this);
     $style->fromAttributes($attribs);
     $this->setStyle($style);
     $surface->setStyle($style);
     $this->applyTransform($attribs);
 }
コード例 #3
0
ファイル: AbstractTag.php プロジェクト: abdulghanni/gsm
 /**
  * Make a style object from the tag and its attributes
  *
  * @param array $attributes
  *
  * @return Style
  */
 protected function makeStyle($attributes)
 {
     $style = new Style();
     $style->inherit($this);
     $style->fromStyleSheets($this, $attributes);
     $style->fromAttributes($attributes);
     return $style;
 }