add [r, g, b] field to triangle, so we can draw coloured objects (next: add ability to change current colour)
This commit is contained in:
@@ -90,6 +90,9 @@ struct
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
|
||||
val newUndo = newUndoHd :: undo
|
||||
@@ -112,6 +115,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -138,9 +144,22 @@ struct
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
|
||||
val newTriangle = {x1 = x1, y1 = y1, x2 = x2, y2 = y2, x3 = x3, y3 = y3}
|
||||
val newTriangle =
|
||||
{ x1 = x1
|
||||
, y1 = y1
|
||||
, x2 = x2
|
||||
, y2 = y2
|
||||
, x3 = x3
|
||||
, y3 = y3
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
val newTriangles = newTriangle :: triangles
|
||||
val newUndo = newUndoHd :: undo
|
||||
in
|
||||
@@ -162,6 +181,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -186,6 +208,9 @@ struct
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
in
|
||||
{ mode = mode
|
||||
@@ -206,6 +231,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -230,6 +258,9 @@ struct
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
in
|
||||
{ mode = mode
|
||||
@@ -250,6 +281,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -276,6 +310,9 @@ struct
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
|
||||
val xClickPoints = ClickPoints.generate (wStart, wFinish, numClickPoints)
|
||||
@@ -299,6 +336,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -346,6 +386,9 @@ struct
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
in
|
||||
{ mode = mode
|
||||
@@ -366,6 +409,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -391,6 +437,9 @@ struct
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
|
||||
val newUndo =
|
||||
@@ -418,6 +467,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -443,6 +495,9 @@ struct
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
|
||||
val newUndo = newUndoHd :: undo
|
||||
@@ -469,6 +524,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -493,6 +551,9 @@ struct
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
in
|
||||
{ mode = mode
|
||||
@@ -513,6 +574,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -537,6 +601,9 @@ struct
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
in
|
||||
{ mode = newMode
|
||||
@@ -557,6 +624,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -581,6 +651,9 @@ struct
|
||||
, openFilePath
|
||||
, fileBrowser
|
||||
, fileBrowserIdx
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
|
||||
val triangleStage = NO_TRIANGLE
|
||||
@@ -603,6 +676,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = fileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -627,6 +703,9 @@ struct
|
||||
, openFilePath = _
|
||||
, fileBrowser = _
|
||||
, fileBrowserIdx = _
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
in
|
||||
{ mode = mode
|
||||
@@ -647,6 +726,9 @@ struct
|
||||
, openFilePath = path
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = 0
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
|
||||
@@ -671,6 +753,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = _
|
||||
, r
|
||||
, g
|
||||
, b
|
||||
} = app
|
||||
in
|
||||
{ mode = mode
|
||||
@@ -691,6 +776,9 @@ struct
|
||||
, openFilePath = openFilePath
|
||||
, fileBrowser = fileBrowser
|
||||
, fileBrowserIdx = newFileBrowserIdx
|
||||
, r = r
|
||||
, g = g
|
||||
, b = b
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user