@@ -233,7 +233,16 @@ function imagebox:draw(ctx, cr, width, height)
233
233
cr :clip (self ._private .clip_shape (cr , w * aspects .w , h * aspects .h , unpack (self ._private .clip_args )))
234
234
end
235
235
236
- cr :scale (aspects .w , aspects .h )
236
+ if self ._private .handle then
237
+ self ._private .handle :render_document (cr , Rsvg .Rectangle {
238
+ x = 0 ,
239
+ y = 0 ,
240
+ width = w * aspects .w ,
241
+ height = h * aspects .h
242
+ })
243
+ else
244
+ cr :scale (aspects .w , aspects .h )
245
+ end
237
246
else
238
247
if self ._private .halign == " center" then
239
248
translate .x = math.floor ((width - w )/ 2 )
@@ -253,11 +262,13 @@ function imagebox:draw(ctx, cr, width, height)
253
262
if self ._private .clip_shape then
254
263
cr :clip (self ._private .clip_shape (cr , w , h , unpack (self ._private .clip_args )))
255
264
end
265
+
266
+ if self ._private .handle then
267
+ self ._private .handle :render_document (cr , Rsvg .Rectangle {x = 0 , y = 0 , width = w , height = h })
268
+ end
256
269
end
257
270
258
- if self ._private .handle then
259
- self ._private .handle :render_cairo (cr )
260
- else
271
+ if not self ._private .handle then
261
272
cr :set_source_surface (self ._private .image , 0 , 0 )
262
273
263
274
local filter = self ._private .scaling_quality
0 commit comments