Fixed selected object ordering

This commit is contained in:
Yousef Khadadeh 2025-12-31 10:06:26 +03:00
parent 9d752af00c
commit b688c39e68
6 changed files with 52 additions and 68 deletions

View file

@ -19,12 +19,11 @@ class DrawingProgramSelection {
void update();
void deselect_all();
void paste_clipboard(Vector2f pasteScreenPos);
const std::unordered_set<CanvasComponentContainer::ObjInfo*>& get_selected_set();
std::unordered_set<CanvasComponentContainer::ObjInfo*> get_selection_as_set();
void delete_all();
void selection_to_clipboard();
CanvasComponentContainer::ObjInfo* get_front_object_colliding_with_in_editing_layer(const SCollision::ColliderCollection<float>& cC);
private:
void draw_components_recursive(const DrawingProgramLayerListItem& layerItem, SkCanvas* canvas, const DrawData& drawData);
bool mouse_collided_with_selection_aabb();
bool mouse_collided_with_scale_point();
bool mouse_collided_with_rotate_center_handle_point();
@ -34,16 +33,17 @@ class DrawingProgramSelection {
void rebuild_cam_space();
Vector2f get_rotation_point_pos_from_angle(double angle);
void set_to_selection(const std::unordered_set<CanvasComponentContainer::ObjInfo*>& newSelection);
void add_to_selection(const std::unordered_set<CanvasComponentContainer::ObjInfo*>& newSelection);
void set_to_selection(const std::vector<CanvasComponentContainer::ObjInfo*>& newSelection);
void add_to_selection(const std::vector<CanvasComponentContainer::ObjInfo*>& newSelection);
void sort_selection();
void calculate_aabb();
void reset_all();
std::function<bool(const std::shared_ptr<DrawingProgramCacheBVHNode>&)> erase_select_objects_in_bvh_func(std::unordered_set<CanvasComponentContainer::ObjInfo*>& selectedComponents, const SCollision::ColliderCollection<float>& cC, const SCollision::ColliderCollection<WorldScalar>& cCWorld, DrawingProgramLayerManager::LayerSelector layerSelector);
std::function<bool(const std::shared_ptr<DrawingProgramCacheBVHNode>&)> erase_select_objects_in_bvh_func(std::vector<CanvasComponentContainer::ObjInfo*>& selectedComponents, const SCollision::ColliderCollection<float>& cC, const SCollision::ColliderCollection<WorldScalar>& cCWorld, DrawingProgramLayerManager::LayerSelector layerSelector);
SCollision::ColliderCollection<float> camSpaceSelection;
std::array<WorldVec, 4> selectionRectPoints;
CoordSpaceHelperTransform selectionTransformCoords;
std::unordered_set<CanvasComponentContainer::ObjInfo*> selectedSet;
std::vector<CanvasComponentContainer::ObjInfo*> selectedSet;
SCollision::AABB<WorldScalar> initialSelectionAABB;
DrawingProgram& drawP;