mirror of
https://github.com/sbrow/ps.git
synced 2025-12-29 18:47:38 -05:00
gitflow-hotfix-stash: v1.0
This commit is contained in:
36
structs.go
36
structs.go
@@ -72,6 +72,10 @@ func (d *Document) Name() string {
|
||||
return d.name
|
||||
}
|
||||
|
||||
func (d *Document) Parent() Group {
|
||||
return nil
|
||||
}
|
||||
|
||||
// The height of the document, in pixels.
|
||||
func (d *Document) Height() int {
|
||||
return d.height
|
||||
@@ -100,9 +104,6 @@ func (d *Document) LayerSet(name string) *LayerSet {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *Document) Parent() Group {
|
||||
return nil
|
||||
}
|
||||
func (d *Document) SetParent(g Group) {}
|
||||
|
||||
func (d *Document) Path() string {
|
||||
@@ -178,21 +179,21 @@ func (d *Document) Dump() {
|
||||
f.Write(byt)
|
||||
}
|
||||
|
||||
// ArtLayer reflects certain values from an Art Layer in a Photoshop document.
|
||||
// ArtLayer reflects some values from an Art Layer in a Photoshop document.
|
||||
//
|
||||
// TODO: Make TextLayer a subclass of ArtLayer.
|
||||
type ArtLayer struct {
|
||||
name string // The layer's name.
|
||||
Text *string // The contents of a text layer.
|
||||
bounds [2][2]int // The layers' corners.
|
||||
parent Group // The LayerSet/Document this layer is in.
|
||||
visible bool // Whether or not the layer is visible.
|
||||
current bool // Whether we've checked this layer since we loaded from disk.
|
||||
Color // The layer's color overlay.
|
||||
*Stroke // The layer's stroke.
|
||||
name string // The layer's name.
|
||||
bounds [2][2]int // The corners of the layer's bounding box.
|
||||
parent Group // The LayerSet/Document this layer is in.
|
||||
visible bool // Whether or not the layer is visible.
|
||||
current bool // Whether we've checked this layer since we loaded from disk.
|
||||
Color // The layer's color overlay effect (if any).
|
||||
*Stroke // The layer's stroke effect (if any).
|
||||
*TextItem // The layer's text, if it's a text layer.
|
||||
}
|
||||
|
||||
// Bounds returns the furthest corners of the ArtLayer.
|
||||
// Bounds returns the coordinates of the corners of the ArtLayer's bounding box.
|
||||
func (a *ArtLayer) Bounds() [2][2]int {
|
||||
return a.bounds
|
||||
}
|
||||
@@ -257,6 +258,11 @@ func (a *ArtLayer) Name() string {
|
||||
return a.name
|
||||
}
|
||||
|
||||
// Parent returns the Document or LayerSet this layer is contained in.
|
||||
func (a *ArtLayer) Parent() Group {
|
||||
return a.parent
|
||||
}
|
||||
|
||||
// X1 returns the layer's leftmost x value.
|
||||
func (a *ArtLayer) X1() int {
|
||||
return a.bounds[0][0]
|
||||
@@ -363,10 +369,6 @@ func (a *ArtLayer) SetStroke(stk Stroke, fill Color) {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *ArtLayer) Parent() Group {
|
||||
return a.parent
|
||||
}
|
||||
|
||||
func (a *ArtLayer) Path() string {
|
||||
return fmt.Sprintf("%s%s", a.parent.Path(), a.name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user