I am having the issue of my greater than/less than comparison not working.
Here is what is happening:
Let's say I have a square, and I'm getting the minimum and maximum points of this square in space, ex. minPoint = (0,0,0) and maxPoint = (1,1,1)
I am placing text on this face but I need the text to be inside the square face, if it isn't then I reduce the size until it fits.
Here is my code after properly getting the distance of both the minPt to the maxPt, and also the minPt to the text location.
Here is my line of code that is not working:
If sizeYPt <= sizeY And sizeXPt <= sizeX Then Exit Do
It works for most situations but I have had situations where it won't work. One thing I noticed is that sizeYPt is the same as sizeY, and sizeXPt is smaller than sizeX (which should all be true!!! argh)
Anyone know what the issue could be? Here is my full code:
Dim sizeY, sizeX, sizeYPt, sizeXPt As Double
Dim yVect, xVect As New VISIVector
yVect.Put(0, 1, 0)
xVect.Put(1, 0, 0)
sizeY = Util.dist2pts_alongAxis(centerPoint, p2, yVect)
sizeYPt = Util.dist2pts_alongAxis(centerPoint, txtPt, yVect)
sizeX = Util.dist2pts_alongAxis(p1, p2, xVect)
sizeXPt = Util.dist2pts_alongAxis(p1, txtPt, xVect)
If sizeY.ToString.Contains("-") Then sizeY = sizeY * -1
If sizeYPt.ToString.Contains("-") Then sizeYPt = sizeYPt * -1
If sizeX.ToString.Contains("-") Then sizeX = sizeX * -1
If sizeXPt.ToString.Contains("-") Then sizeXPt = sizeXPt * -1
MsgBox(sizeYPt & " | " & sizeY & vbNewLine & sizeXPt & " | " & sizeX)
If sizeYPt <= sizeY And sizeXPt <= sizeX Then Exit Do