Jump to content


Radial Gradient Problem

  • Please log in to reply
2 replies to this topic

#1 pstudio

  • Members
  • 2 posts

Posted 21 February 2013 - 06:04 AM

Using SMS

When I try to create a radial gradient I simply Get a DOM Exception "Not supported" when I try and run the program. There are no problems with linear gradients and I now my Chrome supports radial gradients.

Is it just me who can't create radial gradients or is there maybe a bug in SMS?

#2 gabr42



  • Administrators
  • 192 posts

Posted 21 February 2013 - 10:54 AM

There was a bug in the RTL library in this version, if I recall correctly.

An excerpt from my book:

E> There's a bug in the `CreateRadialGradientF` implementation which prevents
E> radial gradients from being created. To fix it, open the *w3graphics* unit
E> (click on the `w3graphics` in the `uses` list of the unit and press Ctrl+Enter).
E> Find the `CreateRadialGradientF` function. In the line where
E> `FDC.createRadialGradient` is called, add parameter `r0` after `y0`.
E> Save, close and recompile and radial gradients should work.
E> {lang="delphi"}
E> ~~~~~~~~~~~~~~~
E> function TW3Canvas.CreateRadialGradientF(x0,y0,r0,
E>   x1,y1,r1:Float):TW3CanvasGradient;
E> var
E>   mTemp: THandle;
E> begin
E>   try
E>    // mTemp:=FDC.createRadialGradient(x0,y0,x1,y1,r1); //original code
E>     mTemp:=FDC.createRadialGradient(x0,y0,r0,x1,y1,r1); //correction
E> except
E>   on e: exception do
E>     Raise Exception.Create('Failed to create gradient object:' +
E>       e.message);
E>   end;
E>   result:=TW3CanvasGradient.Create(mTemp);
E> end;

You can also try the http://www.gabrijelc...Smart/Graphics/ demo, it works fine in Chrome (at least for me).

A chapter on Smart graphics (which includes the radial gradient demo) is available for free at https://leanpub.com/asmartbook (click "Download a sample PDF").

In any case I would suggest upgrading to RC.

#3 pstudio

  • Members
  • 2 posts

Posted 21 February 2013 - 04:58 PM

Ok, so there was a bug in the RTL. I've download the latest build. Thanks.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users