Thanks for the links, I'll take a look.


-----Urspr√ľngliche Nachricht-----
Von: John Smith [] 
Gesendet: Donnerstag, 12. Juni 2014 22:05
An: Robert Fisher;
Betreff: RE: Blurry strokes and zooming via scale transforms

A couple of related stackoverflow questions won't solve your problem, but will 
provide some background info:

-----Original Message-----
From: openjfx-dev [] On Behalf Of 
Robert Fisher
Sent: Thursday, June 12, 2014 3:10 AM
Subject: AW: Blurry strokes and zooming via scale transforms

Well suppose I have a Rectangle with a size of 100x100 and stroke-width of 1, 
and I apply a scale transform to zoom in to 150%.

Then I would like to see a size of 150x150 pixels and still see a sharp border 
stroke, let's say with a width of 2 pixels.

I'm not sure how I could apply a snapping transformation to just correct stroke 
widths and not disturb the size of the shapes themselves.


-----Urspr√ľngliche Nachricht-----
Von: openjfx-dev [] Im Auftrag von 
Tom Eugelink
Gesendet: Donnerstag, 12. Juni 2014 11:42
Betreff: Re: Blurry strokes and zooming via scale transforms

I recently had a similar situation, but then because certain properties were 
calculated-via-binding and the resulting value was not "snapped" to good values 

This resulted in my suggestion to allow custom calculations in bindings, which 
would then snap the value.

And transformations on such values have the same effect of course. I was 
wondering, similar to the binding suggestion, would it be possible to apply a 
snapping transformation as the last transformation?


On 2014-6-12 10:56, Robert Fisher wrote:
> Hi all,
> I'm trying to avoid the blurry strokes you can get in JavaFX in some cases, 
> e.g. for a non-integer stroke width, or a stroke width of 1 and 
> StrokeType.CENTERED.
> So far my 'solution' to this problem has been to round layout values to 
> integers, or to round and add 0.5 in the StrokeType.CENTERED case.
> However this approach is pretty useless if I apply a scale transform 
> afterwards, which is the simplest way I know to create a zooming mechanism.
> So my question is: is there any way I can round things to integer values 
> *after* transforms have been applied? Or tell the renderer to not try to 
> approximate strokes drawn 'off-pixel' but instead to round & move them to the 
> nearest pixel so that lines look sharp and clean?
> Any tips would be appreciated.
> Cheers,
> Rob

Reply via email to