C
ChrisB
Hi all, I've written a function to return true or false if the value I
supply to it is close to a predefined column:
Private Function IsOnColumn(ByVal Position As Integer) As Boolean
Const COLUMN_WIDTH As Integer = 100
Const SNAP_DISTANCE As Integer = 20
Return (Position Mod COLUMN_WIDTH > COLUMN_WIDTH - SNAP_DISTANCE
OrElse Position Mod COLUMN_WIDTH < SNAP_DISTANCE)
End Function
I've been trying to modify it so that the column detection shifts to the
left (COLUMN_WIDTH /2). So instead of the columns appearing at 0, 100, 200,
300 400 etc., they appear at 50, 150, 250, 350, 450 and so on, but I'm
pulling hair out!
Can anyone help?
Many thanks,
Chris.
supply to it is close to a predefined column:
Private Function IsOnColumn(ByVal Position As Integer) As Boolean
Const COLUMN_WIDTH As Integer = 100
Const SNAP_DISTANCE As Integer = 20
Return (Position Mod COLUMN_WIDTH > COLUMN_WIDTH - SNAP_DISTANCE
OrElse Position Mod COLUMN_WIDTH < SNAP_DISTANCE)
End Function
I've been trying to modify it so that the column detection shifts to the
left (COLUMN_WIDTH /2). So instead of the columns appearing at 0, 100, 200,
300 400 etc., they appear at 50, 150, 250, 350, 450 and so on, but I'm
pulling hair out!
Can anyone help?
Many thanks,
Chris.