@@ -743,6 +743,48 @@ Size2 AnimationBezierTrackEdit::get_minimum_size() const {
743743 return Vector2 (1 , 1 );
744744}
745745
746+ Control::CursorShape AnimationBezierTrackEdit::get_cursor_shape (const Point2 &p_pos) const {
747+ // Box selecting or moving a handle
748+ if (box_selecting || Math::abs (moving_handle) == 1 ) {
749+ return get_default_cursor_shape ();
750+ }
751+ // Hovering a handle
752+ if (!read_only) {
753+ for (const EditPoint &edit_point : edit_points) {
754+ if (edit_point.in_rect .has_point (p_pos) || edit_point.out_rect .has_point (p_pos)) {
755+ return get_default_cursor_shape ();
756+ }
757+ }
758+ }
759+ // Currently box scaling
760+ if (scaling_selection) {
761+ if (scaling_selection_handles == Vector2i (1 , 1 ) || scaling_selection_handles == Vector2i (-1 , -1 )) {
762+ return CURSOR_FDIAGSIZE;
763+ } else if (scaling_selection_handles == Vector2i (1 , -1 ) || scaling_selection_handles == Vector2i (-1 , 1 )) {
764+ return CURSOR_BDIAGSIZE;
765+ } else if (abs (scaling_selection_handles.x ) == 1 ) {
766+ return CURSOR_HSIZE;
767+ } else if (abs (scaling_selection_handles.y ) == 1 ) {
768+ return CURSOR_VSIZE;
769+ }
770+ }
771+ // Hovering the scaling box
772+ const Vector2i rel_pos = p_pos - selection_rect.position ;
773+ if (selection_handles_rect.has_point (p_pos)) {
774+ if ((rel_pos.x < 0 && rel_pos.y < 0 ) || (rel_pos.x > selection_rect.size .width && rel_pos.y > selection_rect.size .height )) {
775+ return CURSOR_FDIAGSIZE;
776+ } else if ((rel_pos.x < 0 && rel_pos.y > selection_rect.size .height ) || (rel_pos.x > selection_rect.size .width && rel_pos.y < 0 )) {
777+ return CURSOR_BDIAGSIZE;
778+ } else if (rel_pos.x < 0 || rel_pos.x > selection_rect.size .width ) {
779+ return CURSOR_HSIZE;
780+ } else if (rel_pos.y < 0 || rel_pos.y > selection_rect.size .height ) {
781+ return CURSOR_VSIZE;
782+ }
783+ return CURSOR_MOVE;
784+ }
785+ return get_default_cursor_shape ();
786+ }
787+
746788void AnimationBezierTrackEdit::set_timeline (AnimationTimelineEdit *p_timeline) {
747789 timeline = p_timeline;
748790 timeline->connect (" zoom_changed" , callable_mp (this , &AnimationBezierTrackEdit::_zoom_changed));
0 commit comments