public Layer(string groupName, PsdParser.PSDLayer psdLayer) { this.groupName = groupName; this.psdLayer = psdLayer; }
public Layer(PsdParser.PSDLayer psdLayer) { this.psdLayer = psdLayer; if (this.psdLayer.isTextLayer) this.text = this.psdLayer.text.Replace('\r', '\n'); }
private int loadPsdLayer(string groupName, int i, PsdParser.PSDLayer[] psdLayers) { while (i >= 0) { var psdLayer = psdLayers[i--]; if (psdLayer.groupStarted) { var temp = groupName; temp += string.IsNullOrEmpty(groupName) ? "" : "_"; temp += psdLayer.name + "_"; i = this.loadPsdLayer(temp, i, psdLayers); } else if (psdLayer.groupEnded) { break; } else if (psdLayer.hasData) { this.layers.Add(new Layer(groupName, psdLayer)); } } return i; }
private int LoadPsdLayers(Layer parent, PsdParser.PSDLayer[] psdLayers, int i) { while (i >= 0) { var psdLayer = psdLayers[i--]; if (psdLayer.groupStarted) { var newParent = new Layer(psdLayer); parent.children.Add(newParent); i = this.LoadPsdLayers(newParent, psdLayers, i); if (psdLayer.name.Contains("@ignore")) parent.children.Remove(newParent); } else if (psdLayer.groupEnded) { parent.children.Reverse(); break; } else if (!psdLayer.drop && !psdLayer.name.Contains("@ignore")) { parent.children.Add(new Layer(psdLayer)); } } return i; }