Commit Graph

132 Commits

Author SHA1 Message Date
4b3165084d Move scoped functionality into local function 2021-06-22 16:40:56 +09:00
0c8851f4b7 Extract drawable.ScreenSpaceDrawQuad to a variable 2021-06-11 07:06:22 -04:00
a6774eb5b5 Inline getOriginPositionFromQuad 2021-06-11 06:59:00 -04:00
c9b4f9eb71 Make getOriginPositionFromQuad local 2021-06-11 06:55:47 -04:00
1bc8460902 Rename getTieredComponent to getAnchorFromPosition
Also rename parameter `component` to `xOrY`.
2021-06-11 06:53:40 -04:00
6e181a6b63 Rename parameters of getTieredComponent 2021-06-11 06:53:04 -04:00
a76eaeb52d Make getTieredComponent local 2021-06-11 06:51:12 -04:00
635300b311 Recalculate closest anchor when origin is changed 2021-06-11 06:28:30 -04:00
a506f2a776 Revert rename of lambda variables 2021-06-11 06:22:24 -04:00
10b6b72909 Add guard clause to applyOrigins and rename parameter 2021-06-08 10:29:45 -04:00
d212918d67 Rename applyCustomAnchors to applyFixedAnchors for consistency with UsesFixedAnchor 2021-06-08 10:14:07 -04:00
2c88e6df8d Simplify applyClosestAnchor to one line by moving another guard clause 2021-06-08 10:09:48 -04:00
f22cc981d1 Move guard clause from checkAndApplyClosestAnchor to applyAnchor 2021-06-08 09:51:39 -04:00
529a80871b Rename some methods for clarity
Methods which operate on a collection of `ISkinnableDrawable`s are now
plural; ones which take a single item are singular.

This also allows cutting down the name of `getClosestAnchorForDrawable`
to just `getClosestAnchor`.
2021-06-08 09:44:42 -04:00
01da73daf2 Refactor updateDrawableAnchorIfUsingClosest 2021-06-08 09:25:49 -04:00
6b127f50f2 Inline updateDrawableAnchorIfUsingClosest 2021-06-08 09:14:04 -04:00
dc50ae40b9 Rename OverridesClosestAnchor to UsesFixedAnchor 2021-06-08 08:28:42 -04:00
65f594f860 Rename applyAnchor to applyCustomAnchor 2021-06-07 05:08:18 -04:00
6c9594ee35 Simplify and rearrange SkinSelectionHandler
The file has been restructured and reworded such that there are as few
differences as possible from b36b40cb34.
2021-06-07 02:40:15 -04:00
29fa4fdf57 Refactor unacceptable syntax 2021-06-07 01:08:39 -04:00
133d72a8c0 Rename UsingClosestAnchor
It is now "OverridesClosestAnchor". The logic is inverted accordingly.
2021-06-07 00:14:36 -04:00
f28916e30f Remove all UsingClosestAnchor() extension logic
It is replaced with ISkinnableDrawable.UsingClosestAnchor.
2021-06-07 00:04:53 -04:00
6a456e53f4 Rename overly long method 2021-06-06 13:28:17 -04:00
888882ac63 Remove first-person comment 2021-06-06 13:27:13 -04:00
da1c38d5a9 Uninvert logic of SkinnableInfo.UsingClosestAnchor
Also rename "IsUsingClosestAnchor" to simply "UsingClosestAnchor".
2021-06-06 10:13:35 -04:00
63346f6b75 Refactor getTieredComponent 2021-06-06 09:40:58 -04:00
c9f5808bf2 Move lookup logic to DrawableExtensions
This is now a global lookup to be shared by serialization and editor.
2021-06-06 06:58:21 -04:00
4aee76456f Replace localised strings with static English 2021-06-06 05:34:32 -04:00
c452715bf1 Allow skin elements to find closest anchor
- Resolves ppy/osu#13252
- Add localisation strings for the context menu instead of using enum
2021-06-06 01:32:04 -04:00
b36b40cb34 Remove unnecessary double specification 2021-05-26 15:20:47 +09:00
65649e5a62 Prevent skin editor crash when scaling 0 area drawables
Some skinnable drawables can have 0 width or height in certain
cases, leading to division by 0 and a crash when the position is
updated.
2021-05-24 21:36:42 +02:00
45c6a9ca91 Merge branch 'refactor-selection-rotate-logic' into fix-flip-logic-discrepancy 2021-05-22 21:17:58 +09:00
7d88a19d7f Remove unnecessary field storage of origin reference 2021-05-22 21:03:40 +09:00
34a5b22b79 Merge branch 'master' into refactor-selection-rotate-logic 2021-05-22 20:52:28 +09:00
485728ca4e Merge pull request #12866 from peppy/refactor-selection-scale-logic
Add proper scaling support to skin editor
2021-05-22 20:07:03 +09:00
bb2fae55ce Merge branch 'master' into refactor-selection-rotate-logic 2021-05-21 19:19:54 +09:00
0d575f5728 Remove incorrect (and unintended) modulus logic 2021-05-21 15:06:53 +09:00
f9d51656b6 Fix scaling of rotated items not behaving in an understandable way 2021-05-21 15:02:36 +09:00
7845d07dd5 Merge pull request #12886 from peppy/fix-skin-editor-context-menu-sticking
Fix skin editor context menus not dismissing when clicking away
2021-05-20 21:03:35 +09:00
1848bd902d Fix skin editor context menus not dismissing when clicking away 2021-05-20 19:51:07 +09:00
df5970fab4 Create base implementations of the two most common TernaryStateMenuItems 2021-05-20 19:34:53 +09:00
20f1ef4318 Extract common implementation of updating drawable position from screen space pos 2021-05-20 18:35:13 +09:00
6f75c59760 Fix flip logic not using the full selection quad 2021-05-20 18:31:51 +09:00
95c78b9185 Split out common selection quad logic 2021-05-20 18:24:25 +09:00
27e81d6504 Implement proper rotation algorithm for skin editor 2021-05-20 18:21:16 +09:00
eb5db8ff03 Disable border display on skin editor to avoid crashes
This wasn't being displayed correctly anyway, so rather than fixing
let's just remove it for now.

Closes #12868.
2021-05-20 02:01:46 +09:00
a55879e511 Fix oversights in scale algorithm 2021-05-20 01:47:31 +09:00
14af86d6c5 Use the same code path for all scaling 2021-05-19 21:46:41 +09:00
6a3c58b9ad Implement proper scaling algorithms 2021-05-19 19:58:55 +09:00
d661e98fa6 Move common functionality out of OsuSelectionHandler and implement flip support 2021-05-18 18:34:06 +09:00