|
-
Apr 21st, 2002, 09:33 PM
#1
Thread Starter
Frenzied Member
Overflow when dividing
ok...
im making a paint program, and when the user is going to draw a straight line, he has to do as in mspaint: hold down shift....
the problem is when the program is going to calculate the m value and the k value of the line...
here's a bit of the code:
If Shift = 1 Then
KValue = (Y - StartY) / (X - StartX)
MValue = Y - X * KValue
End If
but it cant do the division!! it gives me the overflow error!
why?
-
Apr 23rd, 2002, 02:58 PM
#2
Fanatic Member
make that Abs(X - StartX) >= 1
Abs, so you can draw lines to the left from the current point.
>= 1, because probably someone who draws with your program might want to draw lines with a difference of X which is 1.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|