MCPcopy Create free account
hub / github.com/GraphiteEditor/Graphite / to_reference_point

Method to_reference_point

node-graph/graph-craft/src/document/value.rs:544–568  ·  view source on GitHub ↗
(input: &str)

Source from the content-addressed store, hash-verified

542 }
543
544 fn to_reference_point(input: &str) -> Option<ReferencePoint> {
545 let mut choices = input.split("::");
546 let (first, second) = (choices.next()?.trim(), choices.next()?.trim());
547 if first == "ReferencePoint" {
548 return Some(match second {
549 "None" => ReferencePoint::None,
550 "TopLeft" => ReferencePoint::TopLeft,
551 "TopCenter" => ReferencePoint::TopCenter,
552 "TopRight" => ReferencePoint::TopRight,
553 "CenterLeft" => ReferencePoint::CenterLeft,
554 "Center" => ReferencePoint::Center,
555 "CenterRight" => ReferencePoint::CenterRight,
556 "BottomLeft" => ReferencePoint::BottomLeft,
557 "BottomCenter" => ReferencePoint::BottomCenter,
558 "BottomRight" => ReferencePoint::BottomRight,
559 _ => {
560 log::error!("Invalid ReferencePoint default type variant: {input}");
561 return None;
562 }
563 });
564 }
565
566 log::error!("Invalid ReferencePoint default type: {input}");
567 None
568 }
569
570 match ty {
571 Type::Generic(_) => None,

Callers

nothing calls this directly

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected