@@ -1884,19 +1884,38 @@ fn time_marker_ui(
1884
1884
let is_pointer_in_timeline_rect =
1885
1885
ui. ui_contains_pointer ( ) && timeline_rect. contains ( pointer_pos) ;
1886
1886
1887
- // Show preview?
1888
- if !is_hovering_time_cursor
1887
+ let hovered_ctx_id = egui:: Id :: new ( "hovered timestamp context" ) ;
1888
+
1889
+ let on_timeline = !is_hovering_time_cursor
1889
1890
&& !time_area_double_clicked
1890
1891
&& is_pointer_in_time_area_rect
1891
1892
&& !is_anything_being_dragged
1892
- && !is_hovering_the_loop_selection
1893
+ && !is_hovering_the_loop_selection;
1894
+
1895
+ if on_timeline {
1896
+ ui. ctx ( ) . set_cursor_icon ( timeline_cursor_icon) ;
1897
+ }
1898
+
1899
+ // Show a preview bar at this position, if we have right-clicked
1900
+ // on the time panel we want to still draw the line at the
1901
+ // original position.
1902
+ let hovered_x_pos = if let Some ( hovered_time) =
1903
+ ui. ctx ( ) . memory ( |mem| mem. data . get_temp ( hovered_ctx_id) )
1904
+ && let Some ( x) = time_ranges_ui. x_from_time_f32 ( hovered_time)
1893
1905
{
1906
+ Some ( x)
1907
+ } else if on_timeline {
1908
+ Some ( pointer_pos. x )
1909
+ } else {
1910
+ None
1911
+ } ;
1912
+
1913
+ if let Some ( x) = hovered_x_pos {
1894
1914
time_area_painter. vline (
1895
- pointer_pos . x ,
1915
+ x,
1896
1916
timeline_rect. top ( ) ..=ui. max_rect ( ) . bottom ( ) ,
1897
1917
ui. visuals ( ) . widgets . noninteractive . fg_stroke ,
1898
1918
) ;
1899
- ui. ctx ( ) . set_cursor_icon ( timeline_cursor_icon) ; // preview!
1900
1919
}
1901
1920
1902
1921
// Click to move time here:
@@ -1935,7 +1954,6 @@ fn time_marker_ui(
1935
1954
}
1936
1955
}
1937
1956
1938
- let hovered_ctx_id = egui:: Id :: new ( "hovered timestamp context" ) ;
1939
1957
if let Some ( hovered_time) = ui
1940
1958
. ctx ( )
1941
1959
. memory ( |mem| mem. data . get_temp ( hovered_ctx_id) )
0 commit comments