draw cursor when in NORMAL_SEARCH_MODE
This commit is contained in:
@@ -28,6 +28,27 @@ struct
|
|||||||
, floatWindowHeight
|
, floatWindowHeight
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val cursor =
|
||||||
|
let
|
||||||
|
val xpos = TextConstants.xSpace * (searchCursorIdx + 1) + 5
|
||||||
|
val x = Real32.fromInt xpos
|
||||||
|
val y = Real32.fromInt searchStringPosY
|
||||||
|
val r: Real32.real = 0.67
|
||||||
|
val g: Real32.real = 0.51
|
||||||
|
val b: Real32.real = 0.83
|
||||||
|
in
|
||||||
|
PipeCursor.lerp
|
||||||
|
( x
|
||||||
|
, y
|
||||||
|
, TextConstants.scale
|
||||||
|
, floatWindowWidth
|
||||||
|
, floatWindowHeight
|
||||||
|
, r
|
||||||
|
, g
|
||||||
|
, b
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
val buffer = LineGap.goToLine (startLine, buffer)
|
val buffer = LineGap.goToLine (startLine, buffer)
|
||||||
val startLine = TextWindow.getStartLine
|
val startLine = TextWindow.getStartLine
|
||||||
(buffer, startLine, cursorIdx, windowWidth, windowHeight)
|
(buffer, startLine, cursorIdx, windowWidth, windowHeight)
|
||||||
@@ -45,7 +66,7 @@ struct
|
|||||||
, tempSearchList
|
, tempSearchList
|
||||||
, searchString
|
, searchString
|
||||||
, []
|
, []
|
||||||
, initialTextAcc
|
, cursor :: initialTextAcc
|
||||||
, []
|
, []
|
||||||
)
|
)
|
||||||
in
|
in
|
||||||
|
|||||||
35
fcore/pipe-cursor.sml
Normal file
35
fcore/pipe-cursor.sml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
structure PipeCursor =
|
||||||
|
struct
|
||||||
|
fun xToNdc (xOffset, xpos, scale, halfWidth) =
|
||||||
|
((xpos * scale + xOffset) - halfWidth) / halfWidth
|
||||||
|
|
||||||
|
fun yToNdc (yOffset, ypos, scale, halfHeight) =
|
||||||
|
~(((ypos * scale + yOffset) - halfHeight) / halfHeight)
|
||||||
|
|
||||||
|
fun lerp (xOffset: Real32.real, yOffset, scale, windowWidth, windowHeight, r, g, b) =
|
||||||
|
let
|
||||||
|
val halfWidth = windowWidth / 2.0
|
||||||
|
val halfHeight = windowHeight / 2.0
|
||||||
|
in
|
||||||
|
#[
|
||||||
|
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||||
|
yToNdc (yOffset, 13.000000000000000, scale, halfHeight),
|
||||||
|
r, g, b,
|
||||||
|
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
|
||||||
|
yToNdc (yOffset, 13.000000000000000, scale, halfHeight),
|
||||||
|
r, g, b,
|
||||||
|
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||||
|
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||||
|
r, g, b,
|
||||||
|
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
|
||||||
|
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||||
|
r, g, b,
|
||||||
|
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
|
||||||
|
yToNdc (yOffset, 13.000000000000000, scale, halfHeight),
|
||||||
|
r, g, b,
|
||||||
|
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
|
||||||
|
yToNdc (yOffset, 0.000000000000000, scale, halfHeight),
|
||||||
|
r, g, b
|
||||||
|
]
|
||||||
|
end
|
||||||
|
end
|
||||||
1
shf.mlb
1
shf.mlb
@@ -29,6 +29,7 @@ ann
|
|||||||
"allowVectorExps true"
|
"allowVectorExps true"
|
||||||
in
|
in
|
||||||
fcore/rect.sml
|
fcore/rect.sml
|
||||||
|
fcore/pipe-cursor.sml
|
||||||
fcore/text-builder.sml
|
fcore/text-builder.sml
|
||||||
fcore/cursor-dfa/make-dfa-loop.sml
|
fcore/cursor-dfa/make-dfa-loop.sml
|
||||||
fcore/cursor-dfa/vi-WORD-dfa.sml
|
fcore/cursor-dfa/vi-WORD-dfa.sml
|
||||||
|
|||||||
Reference in New Issue
Block a user