Fix chart drawing tools: place once per click, let tooltip pass clicks through
This commit is contained in:
3 files changed
+10
-6
No files matched your search
@@ -67,6 +67,7 @@ type mktCore struct {
|
||||
candles []Candle
|
||||
view *MarketView
|
||||
from, to int
|
||||
act int // keyboard or click activation, mark plus one; zero is none
|
||||
lo, hi float64
|
||||
base float64 // percent mode divides by this close; 0 is prices
|
||||
dec int
|
||||
@@ -277,9 +278,7 @@ func (m *mktCore) spec() ChartSpec {
|
||||
}
|
||||
if d := m.opts.Drawings; d != nil {
|
||||
spec.Activate = func(i int) {
|
||||
if !d.Locked && d.Tool != ToolSelect {
|
||||
d.place(m, DrawingPoint{m.candles[i].Time, m.candles[i].Close})
|
||||
}
|
||||
m.act = i + 1
|
||||
}
|
||||
}
|
||||
spec.Readout = m.readout
|
||||
|
||||
Reference in new issue
Block a user