MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / GetLineVectorClip

Method GetLineVectorClip

src/visual_tool.cpp:491–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491std::string VisualToolBase::GetLineVectorClip(AssDialogue *diag, int &scale, bool &inverse) {
492 auto blocks = diag->ParseTags();
493
494 scale = 1;
495 inverse = false;
496
497 param_vec tag = find_tag(blocks, "\\iclip");
498 if (tag)
499 inverse = true;
500 else
501 tag = find_tag(blocks, "\\clip");
502
503 if (tag && tag->size() == 4) {
504 return agi::format("m %d %d l %d %d %d %d %d %d"
505 , (*tag)[0].Get<int>(), (*tag)[1].Get<int>()
506 , (*tag)[2].Get<int>(), (*tag)[1].Get<int>()
507 , (*tag)[2].Get<int>(), (*tag)[3].Get<int>()
508 , (*tag)[0].Get<int>(), (*tag)[3].Get<int>());
509 }
510 if (tag) {
511 scale = std::max((*tag)[0].Get(scale), 1);
512 return (*tag)[1].Get<std::string>("");
513 }
514
515 return "";
516}
517
518void VisualToolBase::SetSelectedOverride(std::string const& tag, std::string const& value) {
519 for (auto line : c->selectionController->GetSelectedSet())

Callers

nothing calls this directly

Calls 6

find_tagFunction · 0.85
Get<int>Method · 0.80
formatFunction · 0.70
ParseTagsMethod · 0.45
sizeMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected