MCPcopy Create free account
hub / github.com/cpmech/plotpy / options

Method options

src/text.rs:227–248  ·  view source on GitHub ↗

Returns options for text

(&self)

Source from the content-addressed store, hash-verified

225
226 /// Returns options for text
227 fn options(&self) -> String {
228 let mut opt = String::new();
229 if self.color != "" {
230 write!(&mut opt, ",color='{}'", self.color).unwrap();
231 }
232 if self.align_horizontal != "" {
233 write!(&mut opt, ",ha='{}'", self.align_horizontal).unwrap();
234 }
235 if self.align_vertical != "" {
236 write!(&mut opt, ",va='{}'", self.align_vertical).unwrap();
237 }
238 if self.fontsize > 0.0 {
239 write!(&mut opt, ",fontsize={}", self.fontsize).unwrap();
240 }
241 if let Some(rotation) = self.rotation {
242 write!(&mut opt, ",rotation={}", rotation).unwrap();
243 }
244 if self.extra != "" {
245 write!(&mut opt, ",{}", self.extra).unwrap();
246 }
247 opt
248 }
249
250 /// Returns options for bounding box
251 fn options_bbox(&self) -> String {

Callers 3

drawMethod · 0.45
draw_3dMethod · 0.45
options_worksFunction · 0.45

Calls

no outgoing calls

Tested by 1

options_worksFunction · 0.36