Curl Global Community

Full Version: 【点線について】
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
画面上で『点線』を引きたいのですが、簡単な実装方法はありますか?
こんな感じしか思いつかない。。

Code:
{Fill border-width = 1px, border-color = "#000", height = 1px, border-style = "dash"}

どうやるのが素直なんだろう??
ちなみに斜めに引きたかったりするなら、PathShape や Renderer2d.render-line を使って line-style を指定することになると思います。
斜めに引きたい場合のサンプルコードです

Code:
{define-class LineFrame {inherits Frame}
  {constructor {default ...}
  {construct-super ...}
}
{method public {draw ren:Renderer2d}:void
  def path = {Path
  {Distance2d 0mm, 0mm},
  PathOperation.line-to,
  {Distance2d 20mm, 10mm}
}
{with-render-properties
  fill-pattern = {FillPattern.get-black},
  stroke-thickness = 0.25mm,
  line-style = LineStyle.dash
  on ren do
  {ren.render-path path}
  }
}
}
{LineFrame
  width = 4cm,
  height = 4cm
}