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

Method GetTextHeight

core/graphics/shape/Text.cpp:88–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86float xg::shape::Text::GetSpacingY() const { return std::isnan(lineHeight_) ? fontSize_ * 0.14 : (lineHeight_ - fontSize_); }
87
88float xg::shape::Text::GetTextHeight() const {
89 if(!std::isnan(height_)) {
90 return height_;
91 }
92 const float fontSize = fontSize_ * 1;
93 if(lineCount_ > 1) {
94 return fontSize * lineCount_ + GetSpacingY() * (lineCount_ - 1);
95 }
96 return fontSize;
97}
98
99float xg::shape::Text::GetTextWidth(canvas::CanvasContext &context) const {
100 if(!std::isnan(width_)) {

Callers 2

SetXTipContentMethod · 0.80
CalLegendHeightMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected