mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
text,widget: remove ineffective assignments
Signed-off-by: Serhat Sevki Dincer <jfcgauss@gmail.com>
This commit is contained in:
committed by
Elias Naur
parent
39b1158410
commit
35a8231963
+1
-1
@@ -258,7 +258,7 @@ func makeTestText(shaper *shaperImpl, primaryDir system.TextDirection, fontSize,
|
||||
}
|
||||
simpleText := shaper.shapeAndWrapText(shaper.orderer.sortedFacesForStyle(Font{}), Parameters{PxPerEm: fixed.I(fontSize)}, lineWidth, locale, []rune(simpleSource))
|
||||
complexText := shaper.shapeAndWrapText(shaper.orderer.sortedFacesForStyle(Font{}), Parameters{PxPerEm: fixed.I(fontSize)}, lineWidth, locale, []rune(complexSource))
|
||||
shaper = testShaper(rtlFace, ltrFace)
|
||||
testShaper(rtlFace, ltrFace)
|
||||
return simpleText, complexText
|
||||
}
|
||||
|
||||
|
||||
@@ -117,12 +117,12 @@ func TestEditorReadOnly(t *testing.T) {
|
||||
if cStart != cEnd {
|
||||
t.Errorf("unexpected initial caret positions")
|
||||
}
|
||||
dims := e.Layout(gtx, cache, font, fontSize, nil)
|
||||
e.Layout(gtx, cache, font, fontSize, nil)
|
||||
|
||||
// Select everything.
|
||||
gtx.Ops.Reset()
|
||||
gtx.Queue = &testQueue{events: []event.Event{key.Event{Name: "A", Modifiers: key.ModShortcut}}}
|
||||
dims = e.Layout(gtx, cache, font, fontSize, nil)
|
||||
e.Layout(gtx, cache, font, fontSize, nil)
|
||||
textContent := e.Text()
|
||||
cStart2, cEnd2 := e.Selection()
|
||||
if cStart2 > cEnd2 {
|
||||
@@ -138,7 +138,7 @@ func TestEditorReadOnly(t *testing.T) {
|
||||
// Type some new characters.
|
||||
gtx.Ops.Reset()
|
||||
gtx.Queue = &testQueue{events: []event.Event{key.EditEvent{Range: key.Range{Start: cStart2, End: cEnd2}, Text: "something else"}}}
|
||||
dims = e.Layout(gtx, cache, font, fontSize, nil)
|
||||
e.Layout(gtx, cache, font, fontSize, nil)
|
||||
textContent2 := e.Text()
|
||||
if textContent2 != textContent {
|
||||
t.Errorf("readonly editor modified by key.EditEvent")
|
||||
@@ -147,7 +147,7 @@ func TestEditorReadOnly(t *testing.T) {
|
||||
// Try to delete selection.
|
||||
gtx.Ops.Reset()
|
||||
gtx.Queue = &testQueue{events: []event.Event{key.Event{Name: key.NameDeleteBackward}}}
|
||||
dims = e.Layout(gtx, cache, font, fontSize, nil)
|
||||
dims := e.Layout(gtx, cache, font, fontSize, nil)
|
||||
textContent2 = e.Text()
|
||||
if textContent2 != textContent {
|
||||
t.Errorf("readonly editor modified by delete key.Event")
|
||||
|
||||
@@ -45,7 +45,6 @@ func (s stringSource) ReadAt(b []byte, offset int64) (int, error) {
|
||||
|
||||
// ReplaceRunes is unimplemented, as a stringSource is immutable.
|
||||
func (s stringSource) ReplaceRunes(byteOffset, runeCount int64, str string) {
|
||||
return
|
||||
}
|
||||
|
||||
// Selectable holds text selection state.
|
||||
|
||||
Reference in New Issue
Block a user