I do not understand why the following code returns #True, since it should be #False.
Not using the procedure and using a manual Round function works fine.
But this should work imho...
Hmm, Asm compiler (x86 and x64) returns #True, but C compiler (x86 and x64) returns #False). Strange.
Code: Select all
EnableExplicit
Structure Rectangle
x.f
y.f
width.f
height.f
EndStructure
Procedure.i RectangleRound(*Inout.Rectangle)
If *Inout
*Inout\x = Round(*Inout\x, #PB_Round_Nearest)
*Inout\y = Round(*Inout\y, #PB_Round_Nearest)
*Inout\width = Round(*Inout\width, #PB_Round_Nearest)
*Inout\height = Round(*Inout\height, #PB_Round_Nearest)
EndIf
ProcedureReturn *Inout
EndProcedure
Define Bounds.Rectangle
RectangleRound(@Bounds)
;Round(Bounds\x, #PB_Round_Nearest)
;Round(Bounds\y, #PB_Round_Nearest)
If Bounds\x And Bounds\y
Debug "#True"
Else
Debug "#False"
EndIf