@@ -37,25 +37,32 @@ pub struct PosIndicator<'a> {
3737 pub data : PosIndicatorData ,
3838}
3939
40- impl < ' a > LyonShape < shapes:: Line > for PosIndicator < ' a > {
40+ impl < ' a > LyonShape < shapes:: Rectangle > for PosIndicator < ' a > {
4141 fn get_name ( & self ) -> String {
4242 "Current Pos" . to_string ( )
4343 }
44- fn get_shape ( & self ) -> shapes:: Line {
45- shapes :: Line (
46- Vec2 :: ZERO ,
47- Vec2 :: new (
48- 0.0 ,
49- - self . data . bar_layout . size . height - self . theme . grid . bar_separator_extra * 2.0 ,
50- ) ,
51- )
44+ fn get_shape ( & self ) -> shapes:: Rectangle {
45+ let width = self . theme . grid . pos_indicator_size ;
46+ let height = self . data . bar_layout . size . height + self . theme . grid . bar_separator_extra * 2.0 ;
47+ shapes :: Rectangle {
48+ width ,
49+ height,
50+ origin : shapes :: RectangleOrigin :: TopLeft ,
51+ }
5252 }
5353 fn get_colors ( & self ) -> ShapeColors {
54- ShapeColors :: new ( self . theme . core . pos_indicator_color )
54+ ShapeColors :: outlined (
55+ self . theme
56+ . colors
57+ . of_section ( self . data . bar_props . section_index ) ,
58+ self . theme . core . pos_indicator_color ,
59+ )
5560 }
5661 fn get_draw_mode ( & self ) -> DrawMode {
57- let line_width = self . theme . grid . pos_indicator_size ;
58- DrawMode :: Stroke ( StrokeOptions :: default ( ) . with_line_width ( line_width) )
62+ DrawMode :: Outlined {
63+ fill_options : FillOptions :: default ( ) ,
64+ outline_options : StrokeOptions :: default ( ) . with_line_width ( self . theme . grid . pos_indicator_outline ) ,
65+ }
5966 }
6067 fn get_transform ( & self ) -> Transform {
6168 if self . data . bar_layout . size . width <= 0.0 {
@@ -70,7 +77,7 @@ impl<'a> LyonShape<shapes::Line> for PosIndicator<'a> {
7077 }
7178}
7279
73- impl < ' a > LyonShapeOp < ' a , NotationTheme , PosIndicatorData , shapes:: Line , PosIndicator < ' a > >
80+ impl < ' a > LyonShapeOp < ' a , NotationTheme , PosIndicatorData , shapes:: Rectangle , PosIndicator < ' a > >
7481 for PosIndicator < ' a >
7582{
7683 fn new_shape ( theme : & ' a NotationTheme , data : PosIndicatorData ) -> PosIndicator < ' a > {
0 commit comments