allow width and height to have a different number of click points
This commit is contained in:
@@ -2,7 +2,8 @@ structure Constants =
|
||||
struct
|
||||
val windowWidth = 1000
|
||||
val windowHeight = 900
|
||||
val initialNumClickPoints = 15
|
||||
val initialWidthClickPoints = 16
|
||||
val initialHeightClickPoints = 20
|
||||
|
||||
val graphVertexShaderString =
|
||||
"#version 300 es\n\
|
||||
|
||||
@@ -65,19 +65,31 @@ struct
|
||||
[ x1
|
||||
, ",\n"
|
||||
, y1
|
||||
, ", r, g, b,\n"
|
||||
, ",\n"
|
||||
, r
|
||||
, ",\n"
|
||||
, g
|
||||
, ",\n"
|
||||
, b
|
||||
, ",\n"
|
||||
, x2
|
||||
, ",\n"
|
||||
, y2
|
||||
, ", r, g, b,\n"
|
||||
, ",\n"
|
||||
, r
|
||||
, ",\n"
|
||||
, g
|
||||
, ",\n"
|
||||
, b
|
||||
, ",\n"
|
||||
, x3
|
||||
, ",\n"
|
||||
, y3
|
||||
, ", \n"
|
||||
, ",\n"
|
||||
, r
|
||||
, ", "
|
||||
, ",\n"
|
||||
, g
|
||||
, ", "
|
||||
, ",\n"
|
||||
, b
|
||||
, case tl of
|
||||
[] => "\n"
|
||||
@@ -99,10 +111,8 @@ struct
|
||||
val _ = TextIO.output (io, fileStartString)
|
||||
|
||||
val functionStartString =
|
||||
" fun lerp (startX, startY, drawWidth, drawHeight, windowWidth, windowHeight, r, g, b) : Real32.real vector =\n\
|
||||
" fun lerp (startX, startY, drawWidth, drawHeight, windowWidth, windowHeight) : Real32.real vector =\n\
|
||||
\ let\n\
|
||||
\ val startX = Real32.fromInt startX\n\
|
||||
\ val startY = Real32.fromInt startY\n\
|
||||
\ val endY = windowHeight - startY\n\
|
||||
\ val startY = windowHeight - (startY + drawHeight)\n\
|
||||
\ val endX = startX + drawWidth\n\
|
||||
|
||||
@@ -18,7 +18,8 @@ struct
|
||||
val initialModel = AppInit.fromWindowWidthAndHeight
|
||||
( Constants.windowWidth
|
||||
, Constants.windowHeight
|
||||
, Constants.initialNumClickPoints
|
||||
, Constants.initialWidthClickPoints
|
||||
, Constants.initialHeightClickPoints
|
||||
)
|
||||
|
||||
val graphLines = GraphLines.generate initialModel
|
||||
@@ -27,7 +28,7 @@ struct
|
||||
|
||||
val dotDrawObject = AppDraw.initDot ()
|
||||
val triangleDrawObject = AppDraw.initTriangles ()
|
||||
|
||||
|
||||
val modalTextDrawObject = AppDraw.initModalText ()
|
||||
|
||||
val inputMailbox = Mailbox.mailbox ()
|
||||
|
||||
Reference in New Issue
Block a user