Hello Ted,

Applying scaling means simply multiplication diagonal coefficients of
the transform matrix to the specified scaling values.


> So my logic should be like this
>
> if(currentScaleY < SCALE_MAX)
> {
>         AffineTransform tempAtx = new AffineTransform(currentTransform);
>         tempAtx.preConcatenate(scaleIncrementAtx);
>
>         if(getScaleYElement(getScaleYElement(tempAtx)) < SCALE_MAX)
>         {
>                 currentTransform.preConcatenate(scaleIncrementAtx);
>         }
>         else    // calc the increment that will result in max scale
> value
>         {
>                 // ?? how to calc zoomIncrement in this case ??
>                 zoomIncrement = ??

So, if I understood your task correctly  zoomIncrement should be
SCALE_MAX/currentScaleY.

>
>                 AffineTransform adjustedIncrementAtx =
> AffineTransform.getScaleInstance(zoomIncrement, zoomIncrement);
>
>                 currentTransform.preConcatenate(adjustedIncrementAtx);
>         }
> }

BTW, you could use following check

currentScaleY + scaleIncrementAtx < SCALE_MAX/currentScaleY

instead of

>         if(getScaleYElement(getScaleYElement(tempAtx)) < SCALE_MAX)
>         {

Best Regards,
Alexey

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to