Skip to content

Commit 4d6ddb3

Browse files
committed
Updated changelog.
1 parent a729522 commit 4d6ddb3

File tree

3 files changed

+54
-27
lines changed

3 files changed

+54
-27
lines changed

CHANGELOG.txt

+27-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
11
Changelog
22
InputField
33

4+
v3.3 (2022-03-15)
5+
- Added: Event method wheelmoved() (which can do horizontal scrolling).
6+
- Added: Triple-click-and-drag to select lines.
7+
- Added: Method setType().
8+
- Added: Methods getInfoAtCoords(), getInfoAtCursor(), getInfoAtCharacter().
9+
- Added: Methods getVisibleLine(), getVisibleLineCount().
10+
- Added: Methods getWheelScrollSpeed(), setWheelScrollSpeed().
11+
- Changed: Better/proper shortcuts in macOS.
12+
- Changed: The cursor's original x position is now preserved when navigating vertically multiple lines.
13+
- Changed: Newlines now count as word boundries.
14+
- Changed: Navigating up on the first line or down on the last line now does nothing in multi-line fields.
15+
- Changed: The second argument for setMouseScrollSpeed() is now optional.
16+
- Fixed "pressing Home on wrapped lines does nothing". It now navigates to before the soft line wrap.
17+
- Fixed "pressing Escape does not stop the dragging".
18+
19+
420
v3.2 (2022-03-10)
5-
- Added text alignment (left/right/center).
6-
- Added methods: canScroll, canScrollHorizontally, canScrollVertically.
7-
- Added methods: getScrollHandles, getScrollHandleHorizontal, getScrollHandleVertical.
8-
- PageUp and PageDown work in multi-line fields.
9-
- Keyboard interactions are now disabled while dragging.
21+
- Added: Text alignment (left/right/center).
22+
- Added: PageUp and PageDown work in multi-line fields.
23+
- Added: Methods getScrollHandles(), getScrollHandleHorizontal(), getScrollHandleVertical().
24+
- Added: Methods canScroll(), canScrollHorizontally(), canScrollVertically().
25+
- Changed: Keyboard interactions are now disabled while dragging.
1026

1127
v3.1 (2022-01-15)
12-
- Added double-click-and-drag to select words.
13-
- Added shortcut Shift+Delete to cut text.
14-
- Pressing Escape while dragging stops the dragging.
15-
- Fixed word navigation/selection not working.
16-
- Better Unicode support for word navigation/selection.
28+
- Added: Double-click-and-drag to select words.
29+
- Added: Shortcut Shift+Delete to cut text.
30+
- Changed: Pressing Escape while dragging stops the dragging.
31+
- Changed: Better Unicode support for word navigation/selection.
32+
- Fixed "word navigation/selection does not work".
1733

1834
v3.0.1 (2022-01-14)
19-
- Fixed freezing issue when calling some methods on fields that never had any text.
35+
- Fixed: Freezing issue when calling some methods on fields that never had any text.
2036

2137
v3.0 (2022-01-14)
2238
- First public release!

InputField.lua

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--[[============================================================
22
--=
3-
--= InputField v3.2-dev - text input handling library for LÖVE (0.10.2+)
3+
--= InputField v3.3 - text input handling library for LÖVE (0.10.2+)
44
--= - Written by Marcus 'ReFreezed' Thunström
55
--= - MIT License (See the bottom of this file)
66
--= - https://github.com/ReFreezed/InputField
@@ -52,6 +52,7 @@
5252
getTextDimensions, getTextWidth, getTextHeight
5353
getTextLength
5454
getTextOffset
55+
getVisibleLine, getVisibleLineCount
5556
isBusy
5657
releaseMouse
5758
reset
@@ -133,7 +134,7 @@
133134
--============================================================]]
134135

135136
local InputField = {
136-
_VERSION = "InputField 3.2.0-dev",
137+
_VERSION = "InputField 3.3.0",
137138
}
138139

139140

@@ -974,9 +975,13 @@ function InputField.getMouseScrollSpeedY(field)
974975
return field.mouseScrollSpeedY
975976
end
976977

978+
--
977979
-- field:setMouseScrollSpeed( speedX [, speedY=speedX ] )
978980
-- field:setMouseScrollSpeedX( speedX )
979981
-- field:setMouseScrollSpeedY( speedY )
982+
--
983+
-- Also see setWheelScrollSpeed().
984+
--
980985
function InputField.setMouseScrollSpeed(field, speedX, speedY)
981986
speedY = speedY or speedX
982987
field.mouseScrollSpeedX = math.max(speedX, 0)
@@ -1413,14 +1418,14 @@ function InputField.getScrollHandles(field)
14131418
end
14141419

14151420
-- offset, coverage = field:getScrollHandleHorizontal( )
1416-
-- Values are between 0 and 1.
1421+
-- The values (and their sum) are between 0 and 1.
14171422
function InputField.getScrollHandleHorizontal(field)
14181423
local hOffset, hCoverage, vOffset, vCoverage = field:getScrollHandles()
14191424
return hOffset, hCoverage
14201425
end
14211426

14221427
-- offset, coverage = field:getScrollHandleVertical( )
1423-
-- Values are between 0 and 1.
1428+
-- The values (and their sum) are between 0 and 1.
14241429
function InputField.getScrollHandleVertical(field)
14251430
local hOffset, hCoverage, vOffset, vCoverage = field:getScrollHandles()
14261431
return vOffset, vCoverage
@@ -1520,6 +1525,8 @@ end
15201525
-- lineIndex -- integer Visible line index.
15211526
-- linePosition -- integer Visible line start position.
15221527
--
1528+
-- Note: The coordinates are relative to the field's position.
1529+
--
15231530
function InputField.getInfoAtCursor(field, pos, info)
15241531
updateWrap(field)
15251532

@@ -1565,6 +1572,7 @@ end
15651572
-- linePosition -- integer Visible line start position.
15661573
--
15671574
-- Returns nil if characterPosition is invalid or points at a newline.
1575+
-- Note: The coordinates are relative to the field's position.
15681576
--
15691577
function InputField.getInfoAtCharacter(field, pos, info)
15701578
updateWrap(field)

tests/main.lua

+15-12
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,6 @@ do
186186
field:update(0)
187187
end
188188

189-
do
190-
local field = InputField("fo\no", "password")
191-
192-
assertValue(field:getType(), "password")
193-
assertValue(field:isPassword(), true)
194-
assertValue(field:isMultiline(), false)
195-
196-
-- Text.
197-
assertValue(field:getText(), "foo")
198-
assertValue(field:getVisibleText(), "***")
199-
end
200-
201189
do
202190
local field = InputField("fo\no", "multiwrap")
203191

@@ -208,6 +196,17 @@ do
208196
-- Text.
209197
assertValue(field:getText(), "fo\no")
210198
assertValue(field:getVisibleText(), "fo\no")
199+
200+
-- Type change.
201+
field:setType("password")
202+
203+
assertValue(field:getType(), "password")
204+
assertValue(field:isPassword(), true)
205+
assertValue(field:isMultiline(), false)
206+
207+
-- Text.
208+
assertValue(field:getText(), "foo")
209+
assertValue(field:getVisibleText(), "***")
211210
end
212211

213212
do
@@ -221,12 +220,16 @@ end
221220
-- eachVisibleLine, eachSelection
222221
-- getAlignment, setAlignment
223222
-- getCursorLayout
223+
-- getInfoAtCoords, getInfoAtCursor, getInfoAtCharacter.
224224
-- getScroll, getScrollX, getScrollY, setScroll, setScrollX, setScrollY, scroll, scrollToCursor
225225
-- getScrollHandles, getScrollHandleHorizontal, getScrollHandleVertical
226226
-- getScrollLimits
227227
-- getTextDimensions, getTextWidth, getTextHeight
228228
-- getTextOffset
229+
-- getVisibleLine, getVisibleLineCount.
230+
-- getWheelScrollSpeed, setWheelScrollSpeed.
229231
-- keypressed
232+
-- wheelmoved
230233

231234
print("Tests completed successfully!")
232235
love.event.quit()

0 commit comments

Comments
 (0)