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

Method Repaint

core/graphics/interaction/InteractionContext.cpp:125–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125bool interaction::InteractionContext::Repaint(nlohmann::json &newValues, std::size_t valueStart, std::size_t valueEnd) {
126 const std::string &xField = this->chart_->GetXScaleField();
127 auto &scale = this->chart_->GetScale(xField);
128
129 if(util::isEqualsQuick(scale.values, newValues))
130 return false;
131
132 // chart_->GetLogTracer()->trace("Repaint range: %lu", (valueEnd - valueStart));
133 // TODO 平移或者缩放过程中,ticks 的变化应该由每个度量自行决定。 逻辑暂时保持 ticks 不变
134 UpdateScale(xField, {{"ticks", scale.ticks}, {"domain", {valueStart, valueEnd}}});
135 UpdateFollowScale(scale, newValues, valueStart, valueEnd);
136 this->chart_->Repaint();
137 return true;
138}
139
140void interaction::InteractionContext::UpdateFollowScale(scale::AbstractScale &pinchScale,
141 nlohmann::json &pinchValues,

Callers 2

UpdateRangeMethod · 0.95
handleClickMethod · 0.45

Calls 2

isEqualsQuickFunction · 0.85
GetXScaleFieldMethod · 0.80

Tested by

no test coverage detected