126 |
|
|
127 |
} |
} |
128 |
|
|
129 |
|
private Paper getBg() { |
130 |
|
if(bg == null) { |
131 |
|
if(paperMill == null) |
132 |
|
throw new Error("Trying to use bg without papermill"); |
133 |
|
bg = paperMill.getOptimizedPaper(paperSeed, paperMillWindow); |
134 |
|
} |
135 |
|
return bg; |
136 |
|
} |
137 |
|
|
138 |
public Paper getPaper(boolean withBackground) { |
public Paper getPaper(boolean withBackground) { |
139 |
|
return getPaper(withBackground, true); |
140 |
|
} |
141 |
|
public Paper getPaper(boolean withBackground, boolean withSpan) { |
142 |
|
if(!withSpan) { |
143 |
|
if(!withBackground) throw new Error("Can't do without both"); |
144 |
|
return getBg(); |
145 |
|
} |
146 |
if(withBackground) { |
if(withBackground) { |
|
if(bg == null) { |
|
|
if(paperMill == null) |
|
|
throw new Error("Trying to use bg without papermill"); |
|
|
bg = paperMill.getOptimizedPaper(paperSeed, paperMillWindow); |
|
|
} |
|
147 |
if(withHalo) { |
if(withHalo) { |
148 |
if (bgHaloPaper == null) { |
if (bgHaloPaper == null) { |
149 |
bgHaloPaper = (Paper)bg.clone(); |
bgHaloPaper = (Paper)getBg().clone(); |
150 |
if(bgHaloPaper.getNPasses() == 1 && |
if(bgHaloPaper.getNPasses() == 1 && |
151 |
bgHaloPaper.getPass(0).getNTexGens() == 1) { |
bgHaloPaper.getPass(0).getNTexGens() == 1) { |
152 |
// Draw text-haloed paper |
// Draw text-haloed paper |