[Cuis-dev] A bit faster smoothing
Juan Vuletich
juan at cuis.st
Wed Nov 18 11:20:34 PST 2026
Hi Hilaire,
I like the idea of doing low quality / high quality scaling, so I gave
it a shot. Try the code below. It is not too bad.
Cheers,
PageModelPdf >>
drawOn: canvas
| ct scale formToDraw |
viewport := owner viewport.
ct := canvas currentTransformation.
ct doesNotRotate ifTrue: [
scale := ct scale.
formToDraw := (self preScaledForm notNil and: [ self
preScaledForm extent = (self form extent * scale) truncated ])
ifTrue: [ "If we already have a high quality scaled form,
just use it."
self preScaledForm ]
ifFalse: [
self world lastCycleHadAnyEvent
ifTrue: [ "If we are hardly keeping up with events,
use a low quality scaling, but ask for later redraw to fix quality."
self needsRedraw: true.
self allOwnersDo: [ :m | m submorphNeedsRedraw:
true ].
self form magnify: self form boundingBox by:
scale smoothing: 1 ]
ifFalse: [ "We have some extra time available, use
it to prepare and display a high quality scaled form."
self preScaledForm: (self form magnify: self
form boundingBox by: scale smoothing: 4).
self preScaledForm ]].
canvas geometryTransformation: (MorphicTranslation
withTranslation: ct translation).
canvas image: formToDraw at: 0 at 0.
canvas geometryTransformation: ct ].
On 2026-11-08 1:25 PM, Hilaire Fernandes via Cuis-dev wrote:
>
> Hi Juan,
>
> Do you have any idea how to get a bit faster zooming when smoothing is
> high (cellsize of 4)?
>
> I have prepare an image below, use the black wheel to zoom.
>
> https://www.dropbox.com/scl/fi/azi12o6oob003xclwg2va/dyboSmooth.zip?rlkey=h5wzhmsrnzrhvm5b6jfnbc002&st=powcgut2&dl=0
>
> I think about doing scaling without smoothing then at the latest zoom,
> do a second pass with smoothing. It will make code complicate, so I
> will skip for later optimization.
>
> I opened a ticket, there below, you may want to write idea there so I
> can keep track of them
>
> https://github.com/Dynamic-Book/DyboApp/issues/50
>
> --
> http://mamot.fr/@drgeo
>
--
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20261118/e5ef5ae0/attachment-0001.htm>
More information about the Cuis-dev
mailing list