lib/ctioga2/graphics/elements/primitive.rb in ctioga2-0.11 vs lib/ctioga2/graphics/elements/primitive.rb in ctioga2-0.12
- old
+ new
@@ -243,29 +243,31 @@
styled_primitive("arrow", "arrow",
[ 'point', 'point' ],
Styles::ArrowStyle,
'arrow') do |t, tail, head, style, options|
- style.draw_arrow(t, *( tail.to_figure_xy(t) +
- head.to_figure_xy(t) ))
+ stl = style.dup
+ stl.use_defaults_from(Styles::ArrowStyle::TiogaDefaults)
+ stl.draw_arrow(t, *( tail.to_figure_xy(t) +
+ head.to_figure_xy(t) ))
end
styled_primitive("line", "line",
[ 'point', 'point' ],
- Styles::StrokeStyle,
+ Styles::ArrowStyle,
'line'
) do |t, tail, head, style, options|
- style.draw_line(t, *( tail.to_figure_xy(t) +
- head.to_figure_xy(t) ))
+ style.draw_arrow(t, *( tail.to_figure_xy(t) +
+ head.to_figure_xy(t) ))
end
# @todo Do the same thing for arrows...
styled_primitive("oriented-line", "oriented-line",
[ 'point', 'dimension' ],
Styles::OrientedLineStyle,
'oriented-line'
) do |t, org, dim, style, options|
- style.draw_oriented_line(t, *org.to_figure_xy(t), dim)
+ style.draw_oriented_arrow(t, *org.to_figure_xy(t), dim)
end
styled_primitive("image", "image",
[ CmdArg.new('text', 'file'),