Doubts on LinearGradient#proportional=true

kimtopley at gmail.com kimtopley at gmail.com
Fri Jun 8 08:00:23 PDT 2012


The coordinate origin for the rectangle is not at its top left corner -- the (0, 0) point is at the coordinate origin of its parent.

If you create the rectangle as new Rectangle(0, 0, 90 75) and the translate it, I think you will get the result you want.

Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: Tom Schindl <tom.schindl at bestsolution.at>
Sender: openjfx-dev-bounces at openjdk.java.net
Date: Fri, 08 Jun 2012 16:56:20 
Cc: openjfx-dev at openjdk.java.net<openjfx-dev at openjdk.java.net>
Subject: Re: Doubts on LinearGradient#proportional=true

well then would be a negative value not?

Tom

Am 08.06.12 16:55, schrieb Gerrit Grunwald:
> Ok got it, but it seems the gradient coordinates are related to the
> complete drawing area instead of the node which makes sense to me.
> Otherwise you won't be able to create gradients outside of the bounds of
> a node right ?
> 
> Am 08.06.2012 um 16:50 schrieb Tom Schindl:
> 
>>>>> Group g = new Group();
>>>>> Rectangle r = new Rectangle(40,0,90,75);
>>>>> List<Stop> stops = new ArrayList<Stop>();
>>>>> stops.add(new Stop(0, Color.RED));
>>>>> stops.add(new Stop(1, Color.BLUE));
>>>>> LinearGradient lg = new LinearGradient(0, 0, 90, 0, false,
>>>>> CycleMethod.NO_CYCLE, stops);
>>>>> r.setFill(lg);
>>>>> g.getChildren().add(r);
> 


-- 
B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl                 geschäftsführer/CEO
------------------------------------------------------------------------
eduard-bodem-gasse 5-7/1   A-6020 innsbruck     fax      ++43 512 935833
http://www.BestSolution.at                      phone    ++43 512 935834


More information about the openjfx-dev mailing list