gpui: Add scale
style property
#24352
Closed
+570
−146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements scale transformations in GPUI. This doesn't support independent scaling in the x and y directions due to that not being supported by GPUI's text shaping. When an element has the
scale
property set, it changes its scale relative to its parent.This PR also switches elements to using a relative coordinate system, where the origin is at the upper-left of the element. Events are also in this relative coordinate system, so an
absolute_position
property has been added to events so that code such as right-click menus can use it.Existing code in Zed shouldn't need to many changes to adapt to the new coordinate system. Most code should work as is.
Screencast.from.2025-02-05.23-09-44.webm
TODO:
layout_as_root
(currently causes Zed to appear broken)FileDropEvent
andMouseExitEvent
to relative coordinatesposition
withabsolute_position
, fix deferred)Release Notes: