Jump to content

UniCanvas Drawing


andyhill

Recommended Posts

UniCanvas object "cMain"
I am having a blank moment, what normally is an easy thing is evading me today 😞

moveTo null ???

Getting old is tough, can someone please advise - thanks
 

  //////////////////////////////////////////////////////////////////////////////
  if EventName = '_MouseUp_' then begin
    CanvasUpClk.X:= StrToInt(Params.Values['x']); // TODO Cater For Scale
    CanvasUpClk.Y:= StrToInt(Params.Values['y']); // TODO Cater For Scale
    //
    UniSession.AddJS('var context=fMain.cMain._cc_; '+
                     '{ '+
                     '  context.moveTo('+IntToStr(Round(CanvasUpClk.X))+', '+IntToStr(Round(CanvasUpClk.Y))+'); '+
                     '  context.arc('+IntToStr(Round(CanvasUpClk.X))+', '+IntToStr(Round(CanvasUpClk.Y))+', 2, 0, 2 * Math.PI); '+
                     '  context.stroke(); '+
                     '}; ');
  end;
 

Link to comment
Share on other sites

53 minutes ago, andyhill said:

UniSession.AddJS('var context=fMain.cMain._cc_; '+
                     '{ '+
                     '  context.moveTo('+IntToStr(Round(CanvasUpClk.X))+', '+IntToStr(Round(CanvasUpClk.Y))+'); '+
                     '  context.arc('+IntToStr(Round(CanvasUpClk.X))+', '+IntToStr(Round(CanvasUpClk.Y))+', 2, 0, 2 * Math.PI); '+
                     '  context.stroke(); '+
                     '}; ');

Hello,

Try this method at the beginning:

context.beginPath();
context.moveTo...

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...