Make the transform cage show/hide resize grips as space allows (#2209)

* Changes rotation handles to be around overlay squares

Fixes https://discord.com/channels/731730685944922173/931942323644928040/1330785941786329209

* Fix zero width objects not being selected by slightly nudging the transform

* Follow the categorical limits to render overlay quads

As discussed here: https://discord.com/channels/731730685944922173/931942323644928040/1331166336923074600

* Replace area based calculations with edge based calculations

* Fix 3rd category vis

* Code review

* Add missing powi(2)

* Fixes to handle logic

* Remove single axis prioritisation

* Explicitly check for distance to find nearest handle

* Replace threshold check based on corner vis bounds

* Fix discrepancy at h=12px

* Allow grab when box is too small by disabling resizing within bounds

* Replace inside resize pixel limit

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
mTvare
2025-01-30 01:10:40 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent c5a3c32114
commit a0f8f89e71
10 changed files with 200 additions and 88 deletions
-10
View File
@@ -105,16 +105,6 @@
--color-error-red: #d6536e;
--color-error-red-rgb: 214, 83, 110;
// Keep changes to these colors updated with `editor/src/consts.rs`
--color-overlay-blue: #00a8ff;
--color-overlay-blue-rgb: 0, 168, 255;
--color-overlay-yellow: #ffc848;
--color-overlay-yellow-rgb: 255, 200, 72;
--color-overlay-white: #ffffff;
--color-overlay-white-rgb: 255, 255, 255;
--color-overlay-gray: #cccccc;
--color-overlay-gray-rgb: 204, 204, 204;
--color-data-general: #c5c5c5;
--color-data-general-dim: #767676;
--color-data-raster: #e4bb72;
+4 -2
View File
@@ -1500,8 +1500,10 @@
.box-selection {
position: absolute;
pointer-events: none;
background: rgba(var(--color-overlay-blue-rgb), 0.05);
border: 1px solid var(--color-overlay-blue);
z-index: 2;
// TODO: This will be removed after box selection, and all of graph rendering, is moved to the backend and this whole file
// is removed, but for now this color needs to stay in sync with `COLOR_OVERLAY_BLUE` set in consts.rs of the editor backend.
background: rgba(0, 168, 255, 0.05);
border: 1px solid #00a8ff;
}
</style>