Fixed wierd inconsistency with element core
This commit is contained in:
@@ -257,7 +257,7 @@ func (element *TextBox) runOnChange () {
|
||||
func (element *TextBox) scrollToCursor () {
|
||||
if !element.core.HasImage() { return }
|
||||
|
||||
bounds := element.core.Bounds().Inset(theme.Padding())
|
||||
bounds := element.Bounds().Inset(theme.Padding())
|
||||
bounds.Max.X -= element.valueDrawer.Em().Round()
|
||||
cursorPosition := element.valueDrawer.PositionOf(element.cursor)
|
||||
cursorPosition.X -= element.scroll
|
||||
@@ -272,7 +272,7 @@ func (element *TextBox) scrollToCursor () {
|
||||
}
|
||||
|
||||
func (element *TextBox) draw () {
|
||||
bounds := element.core.Bounds()
|
||||
bounds := element.Bounds()
|
||||
|
||||
// FIXME: take index into account
|
||||
pattern, inset := theme.InputPattern(theme.PatternState {
|
||||
@@ -280,7 +280,7 @@ func (element *TextBox) draw () {
|
||||
Disabled: !element.Enabled(),
|
||||
Focused: element.Focused(),
|
||||
})
|
||||
artist.FillRectangle(element.core, pattern, bounds)
|
||||
artist.FillRectangle(element, pattern, bounds)
|
||||
|
||||
if len(element.text) == 0 && !element.Focused() {
|
||||
// draw placeholder
|
||||
@@ -294,7 +294,7 @@ func (element *TextBox) draw () {
|
||||
Disabled: true,
|
||||
})
|
||||
element.placeholderDrawer.Draw (
|
||||
element.core,
|
||||
element,
|
||||
foreground,
|
||||
offset.Sub(textBounds.Min))
|
||||
} else {
|
||||
@@ -309,7 +309,7 @@ func (element *TextBox) draw () {
|
||||
Disabled: !element.Enabled(),
|
||||
})
|
||||
element.valueDrawer.Draw (
|
||||
element.core,
|
||||
element,
|
||||
foreground,
|
||||
offset.Sub(textBounds.Min))
|
||||
|
||||
@@ -321,7 +321,7 @@ func (element *TextBox) draw () {
|
||||
Case: textBoxCase,
|
||||
})
|
||||
artist.Line (
|
||||
element.core,
|
||||
element,
|
||||
foreground, 1,
|
||||
cursorPosition.Add(offset),
|
||||
image.Pt (
|
||||
|
||||
Reference in New Issue
Block a user