summaryrefslogtreecommitdiff
path: root/def.go
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@code.google.com>2013-11-15 08:04:58 -0500
committerKurt Jung <kurt.w.jung@code.google.com>2013-11-15 08:04:58 -0500
commit807441a526f9094d3c099d422542252a4a0ec964 (patch)
treee052b014f848ea09953116449a1c6dfdeab07d44 /def.go
parent18a535033a6b0b584b7fb1bb6a21a7c980207aa4 (diff)
Brush some lint off using github.com/golang/lint. This includes one breaking change: WriteLinkID instead of WriteLinkId.
Diffstat (limited to 'def.go')
-rw-r--r--def.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/def.go b/def.go
index afdc9f2..bf78fea 100644
--- a/def.go
+++ b/def.go
@@ -22,7 +22,7 @@ import (
// Version of FPDF from which this package is derived
const (
- FPDF_VERSION = "1.7"
+ cnFpdfVersion = "1.7"
)
type blendModeType struct {
@@ -37,17 +37,19 @@ type gradientType struct {
objNum int
}
-// Wd and Ht specify the horizontal and vertical extents of a document page.
+// SizeType fields Wd and Ht specify the horizontal and vertical extents of a
+// document element such as a page.
type SizeType struct {
Wd, Ht float64
}
-// X and Y specify the horizontal and vertical coordinates of a point,
-// typically used in drawing.
+// PointType fields X and Y specify the horizontal and vertical coordinates of
+// a point, typically used in drawing.
type PointType struct {
X, Y float64
}
+// ImageInfoType contains size, color and other information about an image
type ImageInfoType struct {
data []byte
smask []byte
@@ -64,17 +66,18 @@ type ImageInfoType struct {
scale float64 // document scaling factor
}
-// The width and height of the image in the units of the Fpdf object.
+// Extent returns the width and height of the image in the units of the Fpdf
+// object.
func (info *ImageInfoType) Extent() (wd, ht float64) {
return info.w / info.scale, info.h / info.scale
}
-// The width of the image in the units of the Fpdf object.
+// Width returns the width of the image in the units of the Fpdf object.
func (info *ImageInfoType) Width() float64 {
return info.w / info.scale
}
-// The height of the image in the units of the Fpdf object.
+// Height returns the height of the image in the units of the Fpdf object.
func (info *ImageInfoType) Height() float64 {
return info.h / info.scale
}
@@ -116,7 +119,7 @@ type InitType struct {
FontDirStr string
}
-// Principal structure for creating a single PDF document
+// Fpdf is the principal structure for creating a single PDF document
type Fpdf struct {
page int // current page number
n int // current object number