MCPcopy Create free account
hub / github.com/antvis/F2Native / RequestAnimationFrame

Method RequestAnimationFrame

core/graphics/XChart.cpp:596–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

594}
595
596std::size_t XChart::RequestAnimationFrame(func::Command *c, long delay) {
597 if(!canvasContext_ || !canvasContext_->IsValid() || this->requestFrameHandleId_.empty()) {
598 delete c;
599 return 0;
600 }
601 GetLogTracer()->trace("#RequestAnimationFrame handleID: %s", requestFrameHandleId_.data());
602 if(!requestFrameHandleId_.empty()) {
603 long p = reinterpret_cast<long>(c);
604 nlohmann::json data = {{"command", p}, {"delay", delay}};
605 InvokeFunction(requestFrameHandleId_, data.dump());
606 return p;
607 } else {
608 delete c;
609 return 0;
610 }
611}
612
613XChart &XChart::Tooltip(const std::string &json) {
614 return TooltipObject(xg::json::ParseString(json), false);

Callers 3

frameLoopMethod · 0.80
DrawTagContentMethod · 0.80
RenderMethod · 0.80

Calls 4

traceMethod · 0.80
dumpMethod · 0.80
IsValidMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected