Jump to content

How to use Double Vector


skyoxZ
 Share

Recommended Posts

Confirmed. The sample code doesn't fly.

I don't know that this is the fault of the double vector control. The error I get is: cannot implicitly convert 'int' to 'PaintDotNet.Pair<double,double>'

(@BoltBait: Can the error window contents be copied? They seem to be able to be highlighted, just not copied via normal means)

Link to comment
Share on other sites

If you say "Pair.Create(0, 0)" then the Pair.Create static method will return a Pair<int, int>. This is because "0" by itself is an int, so the inferred types to Pair.Create<T1, T2> are int and int.

You can either use "Pair.Create(0.0, 0.0)" (note 0.0) and double will be inferred, or expclitely say "Pair<double, double> x = Pair.Create<double, double>(a, b )".

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

this one doesnt work (the on posted above) 

Pair<double,double> Amount1=Pair.Create(0.0,0.0); // Position

while this works

Pair<double, double> Amount1=Pair.Create(0.0,0.0); // Position

amazing what 1 space can do

Edited by Cookies
CookiesSigPDN2.png

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.

 Share

×
×
  • Create New...