| 1671 | } |
| 1672 | |
| 1673 | m2::RectD BookmarkManager::GetCategoryRect(kml::MarkGroupId categoryId, bool addIconsSize) const |
| 1674 | { |
| 1675 | CHECK_THREAD_CHECKER(m_threadChecker, ()); |
| 1676 | auto const * category = GetBmCategory(categoryId); |
| 1677 | |
| 1678 | m2::RectD categoryRect; |
| 1679 | if (category->IsEmpty()) |
| 1680 | return categoryRect; |
| 1681 | |
| 1682 | for (auto markId : category->GetUserMarks()) |
| 1683 | { |
| 1684 | auto const bookmark = GetBookmark(markId); |
| 1685 | categoryRect.Add(bookmark->GetPivot()); |
| 1686 | } |
| 1687 | if (addIconsSize && !category->GetUserMarks().empty()) |
| 1688 | { |
| 1689 | double const coeff = m_maxBookmarkSymbolSize.y / (m_viewport.PixelRect().SizeY() - m_maxBookmarkSymbolSize.y); |
| 1690 | categoryRect.Add(categoryRect.LeftTop() + m2::PointD(0.0, categoryRect.SizeY() * coeff)); |
| 1691 | } |
| 1692 | for (auto trackId : category->GetUserLines()) |
| 1693 | { |
| 1694 | auto const track = GetTrack(trackId); |
| 1695 | categoryRect.Add(track->GetLimitRect()); |
| 1696 | } |
| 1697 | |
| 1698 | return categoryRect; |
| 1699 | } |
| 1700 | |
| 1701 | kml::CategoryData const & BookmarkManager::GetCategoryData(kml::MarkGroupId categoryId) const |
| 1702 | { |
no test coverage detected