Skip to content

I20260214-1800

@HeikoKlare HeikoKlare tagged this 12 Feb 21:35
Recently, the ability to scale images for the desired target size of a
drawImage operation executed on a GC and the incorporation of a
Transform potentially applied to that GC have been implemented. With
this, the target size for an image to be drawn can become 0 and the
request of a handle of that size can fail, in particular when trying to
rasterize an SVG at that size.

This change adapts the implementation of the handle retrieval for a
desired size in the Image implementation so that the minimum size of the
provided handle is 1 in both of the dimensions. The draw operation in
the GC will then take care of potentially not drawing anything at all
when the actual intended size is really 0.
It also adds a test case for the specific case of requesting a handle at
size 0 and also adds a test for the general correctness of image handle
retrieval when a transform is applied to the GC.

Fixes https://github.com/eclipse-platform/eclipse.platform.swt/issues/3078
Assets 2
Loading