Re: Image scaling for Platform RegisterImage and RegisterRGBAImage?

Neil <[email protected]> Tue, 6 May 2025 23:57:43 -0700 (PDT)
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
Mitchell:

Is there any appetite for modifying the Platform RegisterImage and 
RegisterRGBAImage interfaces to add a scaling parameter? 
...
It might be possible to make scale=1 an optional default parameter, but I 
don’t know enough about C++ to know if that’ll still require downstream 
Platform changes or not.


It is not possible to add a parameter without modifying each downstream 
platform layer implementation. A defaulted parameter doesn't help this case 
- it helps the opposite case where user (or platform layer) code calls into 
platform-independent code.

Using the scale set with SCI_RGBAIMAGESETSCALE for SCI_REGISTERRGBAIMAGE 
could potentially cause problems for applications which set a scale for 
SCI_MARKERDEFINERGBAIMAGE but don't currently reset it before calling 
SCI_REGISTERRGBAIMAGE.

It may be possible to specify a scale factor by adding a scale field to the 
ListOptions struct as that will be ignored by current platform layers. 
However, ListOptions is a set of options to the whole ListBox, not to a 
specific image so would only be OK if all the images were scaled by the 
same factor.

Another approach is to subvert the types used with ScintillaQt::WndProc or 
similar handling Message::RegisterRGBAImage by dynamic casting the ac.lb 
(autocomplete listbox) from interface ListBox to concrete ListBoxImpl then 
calling a private RegisterRGBAImageScaled method. 

Neil

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/80479fe2-6f1c-4574-82b7-9ce31457b872n%40googlegroups.com.