From 7bac25d468d2de6b9993bf274a45ca24bd78c7e8 Mon Sep 17 00:00:00 2001 From: Mike Jensen Date: Fri, 24 Jan 2025 23:27:27 -0700 Subject: [PATCH] [v0.5] Remove Deprecated and Replaced API --- chartdraw/drawing/color.go | 5 ----- chartdraw/drawing/raster_graphic_context.go | 12 ------------ painter.go | 5 ----- painter_test.go | 7 ------- 4 files changed, 29 deletions(-) diff --git a/chartdraw/drawing/color.go b/chartdraw/drawing/color.go index 7655545..e36ed29 100644 --- a/chartdraw/drawing/color.go +++ b/chartdraw/drawing/color.go @@ -135,11 +135,6 @@ func ColorFromRGBA(color string) Color { return c } -// Deprecated: ColorFromRGB is deprecated, use ColorFromRGBA to get colors from RGB or RGBA format strings. -func ColorFromRGB(rgb string) (output Color) { - return ColorFromRGBA(rgb) -} - func parseHex(hex string) uint8 { v, _ := strconv.ParseInt(hex, 16, 16) return uint8(v) diff --git a/chartdraw/drawing/raster_graphic_context.go b/chartdraw/drawing/raster_graphic_context.go index a147bce..e39c2c1 100644 --- a/chartdraw/drawing/raster_graphic_context.go +++ b/chartdraw/drawing/raster_graphic_context.go @@ -76,12 +76,6 @@ func (rgc *RasterGraphicContext) DrawImage(img image.Image) { DrawImage(img, rgc.img, rgc.current.Tr, draw.Over, BilinearFilter) } -// Deprecated: FillString is deprecated, use FillStringAt with (0, 0) for the position. -func (rgc *RasterGraphicContext) FillString(text string) (cursor float64, err error) { - cursor, err = rgc.FillStringAt(text, 0, 0) - return -} - // FillStringAt draws the text at the specified point (x, y). func (rgc *RasterGraphicContext) FillStringAt(text string, x, y float64) (cursor float64, err error) { cursor, err = rgc.CreateStringPath(text, x, y) @@ -89,12 +83,6 @@ func (rgc *RasterGraphicContext) FillStringAt(text string, x, y float64) (cursor return } -// Deprecated: StrokeString is deprecated, use StrokeStringAt with (0, 0) for the position. -func (rgc *RasterGraphicContext) StrokeString(text string) (cursor float64, err error) { - cursor, err = rgc.StrokeStringAt(text, 0, 0) - return -} - // StrokeStringAt draws the contour of the text at point (x, y). func (rgc *RasterGraphicContext) StrokeStringAt(text string, x, y float64) (cursor float64, err error) { cursor, err = rgc.CreateStringPath(text, x, y) diff --git a/painter.go b/painter.go index 1319c70..e8c910c 100644 --- a/painter.go +++ b/painter.go @@ -379,11 +379,6 @@ func (p *Painter) drawSmoothCurve(points []Point, tension float64, dotForSingleP p.quadCurveTo(points[n-2].X, points[n-2].Y, points[n-1].X, points[n-1].Y) } -// Deprecated: SetBackground is Deprecated, use FilledRect with zero for the stroke width. -func (p *Painter) SetBackground(width, height int, color Color) { - p.FilledRect(0, 0, width, height, color, color, 0.0) -} - // drawBackground fills the entire painter area with the given color. func (p *Painter) drawBackground(color Color) { p.FilledRect(0, 0, p.Width(), p.Height(), color, color, 0.0) diff --git a/painter_test.go b/painter_test.go index 46f9b26..4c50fc0 100644 --- a/painter_test.go +++ b/painter_test.go @@ -161,13 +161,6 @@ func TestPainterExternal(t *testing.T) { }, result: "", }, - { - name: "background", - fn: func(p *Painter) { - p.SetBackground(400, 300, ColorWhite) - }, - result: "", - }, { name: "filled_rect", fn: func(p *Painter) {