-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix typos and add more comments/documentation #102
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import ( | |
|
||
// GraphicContext describes the interface for the various backends (images, pdf, opengl, ...) | ||
type GraphicContext interface { | ||
// PathBuilder describes the interface for path drawing | ||
PathBuilder | ||
// BeginPath creates a new path | ||
BeginPath() | ||
|
@@ -27,7 +28,7 @@ type GraphicContext interface { | |
Scale(sx, sy float64) | ||
// SetStrokeColor sets the current stroke color | ||
SetStrokeColor(c color.Color) | ||
// SetStrokeColor sets the current fill color | ||
// SetFillColor sets the current fill color | ||
SetFillColor(c color.Color) | ||
// SetFillRule sets the current fill rule | ||
SetFillRule(f FillRule) | ||
|
@@ -37,27 +38,46 @@ type GraphicContext interface { | |
SetLineCap(cap LineCap) | ||
// SetLineJoin sets the current line join | ||
SetLineJoin(join LineJoin) | ||
// SetLineJoin sets the current dash | ||
// SetLineDash sets the current dash | ||
SetLineDash(dash []float64, dashOffset float64) | ||
// SetFontSize | ||
// SetFontSize sets the current font size | ||
SetFontSize(fontSize float64) | ||
// GetFontSize gets the current font size | ||
GetFontSize() float64 | ||
// SetFontData sets the current FontData | ||
SetFontData(fontData FontData) | ||
// GetFontData gets the current FontData | ||
GetFontData() FontData | ||
// DrawImage draws the raster image in the current canvas | ||
DrawImage(image image.Image) | ||
// Save the context and push it to the context stack | ||
Save() | ||
// Restore remove the current context and restore the last one | ||
Restore() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore remove the current context and restore the last one |
||
// Clear fills the current canvas with a default transparent color | ||
Clear() | ||
// ClearRect fills the specified rectangle with a default transparent color | ||
ClearRect(x1, y1, x2, y2 int) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ClearRect fills the specified rectangle with a default transparent color |
||
// SetDPI sets the current DPI | ||
SetDPI(dpi int) | ||
// GetDPI gets the current DPI | ||
GetDPI() int | ||
// GetStringBounds gets pixel bounds(dimensions) of given string | ||
GetStringBounds(s string) (left, top, right, bottom float64) | ||
// CreateStringPath creates a path from the string s at x, y | ||
CreateStringPath(text string, x, y float64) (cursor float64) | ||
// FillString draws the text at point (0, 0) | ||
FillString(text string) (cursor float64) | ||
// FillStringAt draws the text at the specified point (x, y) | ||
FillStringAt(text string, x, y float64) (cursor float64) | ||
// StrokeString draws the contour of the text at point (0, 0) | ||
StrokeString(text string) (cursor float64) | ||
// StrokeStringAt draws the contour of the text at point (x, y) | ||
StrokeStringAt(text string, x, y float64) (cursor float64) | ||
// Stroke strokes the paths with the color specified by SetStrokeColor | ||
Stroke(paths ...*Path) | ||
// Fill fills the paths with the color specified by SetFillColor | ||
Fill(paths ...*Path) | ||
// FillStroke first fills the paths and than strokes them | ||
FillStroke(paths ...*Path) | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Save the context and push it to the context stack