| 113 | } |
| 114 | |
| 115 | float xg::shape::Text::GetTextHeightWithContext(canvas::CanvasContext &context) const { |
| 116 | if(!std::isnan(height_)) { |
| 117 | return height_; |
| 118 | } |
| 119 | |
| 120 | context.SetFont(font_); |
| 121 | if(textArr_.size()) { |
| 122 | float maxWidth = 0; |
| 123 | for_each(textArr_.begin(), textArr_.end(), |
| 124 | [&maxWidth, &context](const std::string &t) { maxWidth = std::max(maxWidth, context.MeasureTextHeight(t)); }); |
| 125 | return maxWidth; |
| 126 | } else { |
| 127 | return context.MeasureTextHeight(text_); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | void xg::shape::Text::AdaptTextFontSize(canvas::CanvasContext &context, |
| 132 | int padding, int minSize, int maxWidth) { |
nothing calls this directly
no test coverage detected