Compare commits
	
		
			2 Commits
		
	
	
		
			a92951f891
			...
			ddde2a79a8
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ddde2a79a8 | |||
| 180a5eb8d1 | 
@ -336,13 +336,6 @@ func (this *box) handleMouseDown (button input.Button) (caught bool) {
 | 
			
		||||
		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() {
 | 
			
		||||
		if listener(button) { caught = true }
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -62,7 +62,16 @@ func (this *Hierarchy) HandleKeyUp (key input.Key, numberPad bool) {
 | 
			
		||||
// information, HandleMouseMove must be called *before* HandleMouseDown.
 | 
			
		||||
func (this *Hierarchy) HandleMouseDown (button input.Button) {
 | 
			
		||||
	boxes := []anyBox { }
 | 
			
		||||
	first := true
 | 
			
		||||
	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)
 | 
			
		||||
		return !box.handleMouseDown(button)
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
@ -186,12 +186,10 @@ func (this *textBox) drawDot (can canvas.Canvas) {
 | 
			
		||||
	face      := this.attrFace.Value().Face
 | 
			
		||||
	textColor := this.attrTextColor.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 } }
 | 
			
		||||
	
 | 
			
		||||
	pen := can.Pen()
 | 
			
		||||
	pen.Fill(color.Transparent)
 | 
			
		||||
	pen.Stroke(textColor)
 | 
			
		||||
 | 
			
		||||
	bounds  := this.InnerBounds()
 | 
			
		||||
	metrics := face.Metrics()
 | 
			
		||||
@ -204,6 +202,7 @@ func (this *textBox) drawDot (can canvas.Canvas) {
 | 
			
		||||
 | 
			
		||||
	switch {
 | 
			
		||||
	case dot.Empty():
 | 
			
		||||
		pen.Stroke(textColor)
 | 
			
		||||
		pen.StrokeWeight(1)
 | 
			
		||||
		pen.Path(roundPt(start.Add(ascent)), roundPt(start.Sub(descent)))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user