@@ -83,12 +83,12 @@ static void pixbuf_data_to_cairo_data(
83
83
}
84
84
}
85
85
86
- int get_icon_width (cairo_surface_t * icon , double scale ) {
87
- return round ( cairo_image_surface_get_width (icon ) / scale );
86
+ int get_icon_width (cairo_surface_t * icon ) {
87
+ return cairo_image_surface_get_width (icon );
88
88
}
89
89
90
- int get_icon_height (cairo_surface_t * icon , double scale ) {
91
- return round ( cairo_image_surface_get_height (icon ) / scale );
90
+ int get_icon_height (cairo_surface_t * icon ) {
91
+ return cairo_image_surface_get_height (icon );
92
92
}
93
93
94
94
cairo_surface_t * gdk_pixbuf_to_cairo_surface (GdkPixbuf * pixbuf )
@@ -161,7 +161,7 @@ static bool icon_size_clamp(int *w, int *h, int min_size, int max_size) {
161
161
* necessary, it returns the same pixbuf. Transfers full
162
162
* ownership of the reference.
163
163
*/
164
- static GdkPixbuf * icon_pixbuf_scale_to_size (GdkPixbuf * pixbuf , double dpi_scale , int min_size , int max_size )
164
+ static GdkPixbuf * icon_pixbuf_scale_to_size (GdkPixbuf * pixbuf , int min_size , int max_size )
165
165
{
166
166
ASSERT_OR_RET (pixbuf , NULL );
167
167
@@ -170,8 +170,8 @@ static GdkPixbuf *icon_pixbuf_scale_to_size(GdkPixbuf *pixbuf, double dpi_scale,
170
170
171
171
// TODO immediately rescale icon upon scale changes
172
172
if (icon_size_clamp (& w , & h , min_size , max_size )) {
173
- w = round (w * dpi_scale );
174
- h = round (h * dpi_scale );
173
+ // w = round(w * dpi_scale);
174
+ // h = round(h * dpi_scale);
175
175
}
176
176
GdkPixbuf * scaled = gdk_pixbuf_scale_simple (
177
177
pixbuf ,
@@ -183,7 +183,7 @@ static GdkPixbuf *icon_pixbuf_scale_to_size(GdkPixbuf *pixbuf, double dpi_scale,
183
183
return pixbuf ;
184
184
}
185
185
186
- GdkPixbuf * get_pixbuf_from_file (const char * filename , int min_size , int max_size , double scale )
186
+ GdkPixbuf * get_pixbuf_from_file (const char * filename , int min_size , int max_size )
187
187
{
188
188
GError * error = NULL ;
189
189
gint w , h ;
@@ -196,8 +196,8 @@ GdkPixbuf *get_pixbuf_from_file(const char *filename, int min_size, int max_size
196
196
// TODO immediately rescale icon upon scale changes
197
197
icon_size_clamp (& w , & h , min_size , max_size );
198
198
pixbuf = gdk_pixbuf_new_from_file_at_scale (filename ,
199
- round ( w * scale ) ,
200
- round ( h * scale ) ,
199
+ w ,
200
+ h ,
201
201
TRUE,
202
202
& error );
203
203
@@ -270,7 +270,7 @@ char *get_path_from_icon_name(const char *iconname, int size)
270
270
return new_name ;
271
271
}
272
272
273
- GdkPixbuf * icon_get_for_data (GVariant * data , char * * id , double dpi_scale , int min_size , int max_size )
273
+ GdkPixbuf * icon_get_for_data (GVariant * data , char * * id , int min_size , int max_size )
274
274
{
275
275
ASSERT_OR_RET (data , NULL );
276
276
ASSERT_OR_RET (id , NULL );
@@ -380,7 +380,7 @@ GdkPixbuf *icon_get_for_data(GVariant *data, char **id, double dpi_scale, int mi
380
380
g_free (data_chk );
381
381
g_variant_unref (data_variant );
382
382
383
- pixbuf = icon_pixbuf_scale_to_size (pixbuf , dpi_scale , min_size , max_size );
383
+ pixbuf = icon_pixbuf_scale_to_size (pixbuf , min_size , max_size );
384
384
385
385
return pixbuf ;
386
386
}
0 commit comments