Compare commits

...

2 Commits

3 changed files with 11 additions and 10 deletions

View File

@ -336,13 +336,6 @@ func (this *box) handleMouseDown (button input.Button) (caught bool) {
this.invalidateStyle() this.invalidateStyle()
} }
if this.focusable {
this.SetFocused(true)
} else {
hierarchy := this.getHierarchy()
if hierarchy == nil { return }
hierarchy.focus(nil)
}
for _, listener := range this.on.buttonDown.Listeners() { for _, listener := range this.on.buttonDown.Listeners() {
if listener(button) { caught = true } if listener(button) { caught = true }
} }

View File

@ -62,7 +62,16 @@ func (this *Hierarchy) HandleKeyUp (key input.Key, numberPad bool) {
// information, HandleMouseMove must be called *before* HandleMouseDown. // information, HandleMouseMove must be called *before* HandleMouseDown.
func (this *Hierarchy) HandleMouseDown (button input.Button) { func (this *Hierarchy) HandleMouseDown (button input.Button) {
boxes := []anyBox { } boxes := []anyBox { }
first := true
this.boxesUnder(this.mousePosition)(func (box anyBox) bool { this.boxesUnder(this.mousePosition)(func (box anyBox) bool {
if first {
if box.canBeFocused() {
this.focus(box)
} else {
this.focus(nil)
}
first = false
}
boxes = append(boxes, box) boxes = append(boxes, box)
return !box.handleMouseDown(button) return !box.handleMouseDown(button)
}) })

View File

@ -186,12 +186,10 @@ func (this *textBox) drawDot (can canvas.Canvas) {
face := this.attrFace.Value().Face face := this.attrFace.Value().Face
textColor := this.attrTextColor.Value().Color textColor := this.attrTextColor.Value().Color
dotColor := this.attrDotColor.Value().Color dotColor := this.attrDotColor.Value().Color
if textColor == nil { textColor = color.Transparent } if textColor == nil { textColor = color.Black }
if dotColor == nil { dotColor = color.RGBA { G: 255, B: 255, A: 255 } } if dotColor == nil { dotColor = color.RGBA { G: 255, B: 255, A: 255 } }
pen := can.Pen() pen := can.Pen()
pen.Fill(color.Transparent)
pen.Stroke(textColor)
bounds := this.InnerBounds() bounds := this.InnerBounds()
metrics := face.Metrics() metrics := face.Metrics()
@ -204,6 +202,7 @@ func (this *textBox) drawDot (can canvas.Canvas) {
switch { switch {
case dot.Empty(): case dot.Empty():
pen.Stroke(textColor)
pen.StrokeWeight(1) pen.StrokeWeight(1)
pen.Path(roundPt(start.Add(ascent)), roundPt(start.Sub(descent))) pen.Path(roundPt(start.Add(ascent)), roundPt(start.Sub(descent)))