From 000fa53a47a6a443dc68aaf48bc61ff05cb20947 Mon Sep 17 00:00:00 2001 From: rachytski Date: Tue, 8 Feb 2011 01:40:46 +0200 Subject: [PATCH] drawing circles with maximum depth. --- yg/symbol_renderer.cpp | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/yg/symbol_renderer.cpp b/yg/symbol_renderer.cpp index 04faaf82af..fde58d5ae4 100644 --- a/yg/symbol_renderer.cpp +++ b/yg/symbol_renderer.cpp @@ -1,6 +1,7 @@ #include "../base/SRC_FIRST.hpp" #include "symbol_renderer.hpp" #include "skin.hpp" +#include "defines.hpp" #include "../std/bind.hpp" #include "../base/logging.hpp" @@ -57,6 +58,11 @@ namespace yg void SymbolRenderer::drawSymbolImpl(m2::PointD const & pt, uint32_t styleID, EPosition pos, int depth) { ResourceStyle const * style(skin()->fromID(styleID)); + if (style == 0) + { + LOG(LINFO, ("styleID=", styleID, " wasn't found on the current skin")); + return; + } m2::RectU texRect(style->m_texRect); texRect.Inflate(-1, -1); @@ -70,23 +76,6 @@ namespace yg style->m_pageID); } - void SymbolRenderer::drawCircle(m2::PointD const & pt, uint32_t styleID, EPosition pos, int depth) - { - ResourceStyle const * style(skin()->fromID(styleID)); - - m2::RectU texRect(style->m_texRect); - texRect.Inflate(-1, -1); - - m2::PointD posPt = getPosPt(pt, m2::RectD(texRect), pos); - - drawTexturedPolygon(m2::PointD(0, 0), 0, - texRect.minX(), texRect.minY(), texRect.maxX(), texRect.maxY(), - posPt.x, posPt.y, posPt.x + texRect.SizeX(), posPt.y + texRect.SizeY(), - depth, - style->m_pageID); - } - - void mark_intersect(bool & flag) { flag = true; @@ -112,6 +101,11 @@ namespace yg m_symbolsMap[styleID].Add(obj, r); } + void SymbolRenderer::drawCircle(m2::PointD const & pt, uint32_t styleID, EPosition pos, int depth) + { + drawSymbolImpl(pt, styleID, pos, yg::maxDepth); + } + void SymbolRenderer::setClipRect(m2::RectI const & rect) { for (symbols_map_t::const_iterator it = m_symbolsMap.begin(); it != m_symbolsMap.end(); ++it)