Conversation
64a7c2e to
9eb6672
Compare
|
@sbinet I have a bunch of changes that are intended to get the rings package to pass (basically to use cmpimg), but I see so I obviously don't have everything smoothed over. Can you suggest what I might be missing? If this needs source, I'll make a second PR with the changes after this one is merged. |
|
ah, that's the big plot-font/cache migration. I went back in my repo to see what were the mechanics of the migration.
I am running out of cycles for today, but I'll come back tomorrow w/ more. here is a diff I think should point into the right direction: diff --git a/plotter/rings/scale.go b/plotter/rings/scale.go
index 82e3f82..e1200e1 100644
--- a/plotter/rings/scale.go
+++ b/plotter/rings/scale.go
@@ -160,7 +160,13 @@ func (r *Scale) DrawAt(ca draw.Canvas, cen vg.Point) {
}
angle := Angle(iv-min)*scale + arc.Theta
- pt := cen.Add(Rectangular(angle, r.Radius+r.Tick.Length+r.Tick.Label.Font.Extents().Height))
+ pt := cen.Add(Rectangular(
+ angle,
+ r.Radius+r.Tick.Length+r.Tick.Label.Handler.Extents(r.Tick.Label.Font).Height,
+ ))
+
var (
rot Angle
xalign, yalign float64
@@ -190,7 +196,10 @@ func (r *Scale) Plot(ca draw.Canvas, plt *plot.Plot) {
func (r *Scale) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox {
grid := math.Max(float64(r.Grid.Inner), float64(r.Grid.Outer))
radius := math.Max(float64(r.Radius+r.Tick.Length), grid)
- radius = math.Max(radius, float64(r.Tick.Label.Font.Extents().Height*2))
+ radius = math.Max(radius, float64(
+ r.Tick.Label.Handler.Extents(r.Tick.Label.Font).Height*2,
+ ))
return []plot.GlyphBox{{
X: plt.X.Norm(r.X),
Y: plt.Y.Norm(r.Y), |
|
I've created a draft PR w/ some of the API churn handled: but I've seen some labels movement, so there's possibly some "font descent" adjustment to look for... |
sbinet
left a comment
There was a problem hiding this comment.
any reason why we don't use the gonum/tools package for testing imports, formatting et al ?
LGTM otherwise.
go.mod
Outdated
| module gonum.org/v1/exp | ||
|
|
||
| go 1.19 | ||
| go 1.22.0 |
We have lower quality constraints here. |
Please take a look.