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

Method Draw

core/graphics/shape/Element.cpp:13–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11xg::shape::Element::Element() { InitTransform(); }
12
13void xg::shape::Element::Draw(canvas::CanvasContext &context) const {
14 if(IsDestroyed()) {
15 return;
16 }
17
18 if(IsVisible()) {
19 //clip之前需要看是否需要有子shape的多段切割
20// SetContext(context);
21 if (NeedShapeClip(context, [&](string value) {
22 context.Save();
23 DoClipByIdentifier(context, value);
24 ResetContext(context);
25 ResetTransform(context);
26 DrawInner(context);
27 RestoreContext(context);
28 })) {
29 //
30 } else {
31 SetContext(context);
32 //Group 或者 Shape
33 //如果是Group的话,继续调用链路
34 DrawInner(context);
35 RestoreContext(context);
36 }
37 }
38}
39
40void xg::shape::Element::Destroy() {
41 if(IsDestroyed()) {

Callers 1

DrawInnerMethod · 0.45

Calls 1

SaveMethod · 0.45

Tested by

no test coverage detected