mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
cursor-tracker: Add meta_cursor_tracker_get_scale ()
Used in the screenshot UI (and arguably should be used in the existing gnome-shell screenshot drawing code). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1967>
This commit is contained in:
parent
13a2a33257
commit
f6bf1ceb92
@ -362,6 +362,25 @@ meta_cursor_tracker_get_sprite (MetaCursorTracker *tracker)
|
||||
return meta_cursor_sprite_get_cogl_texture (cursor_sprite);
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_cursor_tracker_get_scale:
|
||||
* @tracker:
|
||||
*
|
||||
* Returns:
|
||||
*/
|
||||
float
|
||||
meta_cursor_tracker_get_scale (MetaCursorTracker *tracker)
|
||||
{
|
||||
MetaCursorSprite *cursor_sprite;
|
||||
|
||||
cursor_sprite = META_CURSOR_TRACKER_GET_CLASS (tracker)->get_sprite (tracker);
|
||||
|
||||
if (!cursor_sprite)
|
||||
return 1.0;
|
||||
|
||||
return meta_cursor_sprite_get_texture_scale (cursor_sprite);
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_cursor_tracker_get_hot:
|
||||
* @tracker:
|
||||
|
@ -48,6 +48,9 @@ void meta_cursor_tracker_get_hot (MetaCursorTracker *tracker,
|
||||
META_EXPORT
|
||||
CoglTexture *meta_cursor_tracker_get_sprite (MetaCursorTracker *tracker);
|
||||
|
||||
META_EXPORT
|
||||
float meta_cursor_tracker_get_scale (MetaCursorTracker *tracker);
|
||||
|
||||
META_EXPORT
|
||||
void meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker,
|
||||
graphene_point_t *coords,
|
||||
|
Loading…
Reference in New Issue
Block a user