mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-15 08:22:07 -04:00
scene: Add scaling factor to nodes
This adds a scaling factor that can be used for resizing any type of node and its contents. This is very convenient for animations and previews (e.g. alt-tab windows switching menus).
This commit is contained in:
parent
6c78225160
commit
5a068b5de6
2 changed files with 68 additions and 9 deletions
|
|
@ -66,6 +66,7 @@ struct wlr_scene_node {
|
|||
|
||||
bool enabled;
|
||||
int x, y; // relative to parent
|
||||
double scale;
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
|
|
@ -284,6 +285,11 @@ void wlr_scene_node_set_enabled(struct wlr_scene_node *node, bool enabled);
|
|||
* Set the position of the node relative to its parent.
|
||||
*/
|
||||
void wlr_scene_node_set_position(struct wlr_scene_node *node, int x, int y);
|
||||
/**
|
||||
* Set the scaling factor of the node. This scales the node's children
|
||||
* accordingly.
|
||||
*/
|
||||
void wlr_scene_node_set_scale(struct wlr_scene_node *node, double scale);
|
||||
/**
|
||||
* Move the node right above the specified sibling.
|
||||
* Asserts that node and sibling are distinct and share the same parent.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue