Skip to content

Commit

Permalink
[v0.5] Remove Deprecated and Replaced API
Browse files Browse the repository at this point in the history
  • Loading branch information
jentfoo committed Jan 25, 2025
1 parent baf8168 commit 7bac25d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 29 deletions.
5 changes: 0 additions & 5 deletions chartdraw/drawing/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 0 additions & 12 deletions chartdraw/drawing/raster_graphic_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,13 @@ 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)
rgc.Fill()
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)
Expand Down
5 changes: 0 additions & 5 deletions painter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 0 additions & 7 deletions painter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,6 @@ func TestPainterExternal(t *testing.T) {
},
result: "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 400 300\"><path d=\"M 15 30\nQ25,50 27,55\nQ35,70 37,67\nQ45,60 47,57\nQ55,50 57,60\nQ55,50 65,90\" style=\"stroke-width:1;stroke:black;fill:none\"/></svg>",
},
{
name: "background",
fn: func(p *Painter) {
p.SetBackground(400, 300, ColorWhite)
},
result: "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 400 300\"><path d=\"M 5 10\nL 405 10\nL 405 310\nL 5 310\nL 5 10\" style=\"stroke:none;fill:white\"/></svg>",
},
{
name: "filled_rect",
fn: func(p *Painter) {
Expand Down

0 comments on commit 7bac25d

Please sign in to comment.