forked from AuroraMiddleware/gtk
iconhelper: Compute surface size without icon helper
This is so we can do the next batch of changes
This commit is contained in:
parent
197eeade74
commit
a0ff63e162
@ -200,8 +200,7 @@ get_icon_lookup_flags (GtkIconHelper *self,
|
||||
}
|
||||
|
||||
static void
|
||||
get_surface_size (GtkIconHelper *self,
|
||||
cairo_surface_t *surface,
|
||||
get_surface_size (cairo_surface_t *surface,
|
||||
int *width,
|
||||
int *height)
|
||||
{
|
||||
@ -221,7 +220,8 @@ get_surface_size (GtkIconHelper *self,
|
||||
else
|
||||
{
|
||||
g_warning ("infinite surface size not supported");
|
||||
ensure_icon_size (self, width, height);
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
}
|
||||
|
||||
cairo_destroy (cr);
|
||||
@ -487,8 +487,7 @@ _gtk_icon_helper_get_size (GtkIconHelper *self,
|
||||
switch (gtk_image_definition_get_storage_type (self->def))
|
||||
{
|
||||
case GTK_IMAGE_SURFACE:
|
||||
get_surface_size (self,
|
||||
gtk_image_definition_get_surface (self->def),
|
||||
get_surface_size (gtk_image_definition_get_surface (self->def),
|
||||
&width,
|
||||
&height);
|
||||
break;
|
||||
@ -512,7 +511,7 @@ _gtk_icon_helper_get_size (GtkIconHelper *self,
|
||||
|
||||
if (self->rendered_surface != NULL)
|
||||
{
|
||||
get_surface_size (self, self->rendered_surface, &width, &height);
|
||||
get_surface_size (self->rendered_surface, &width, &height);
|
||||
}
|
||||
else if (self->icon_size != GTK_ICON_SIZE_INVALID)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user