forked from organicmaps/organicmaps
Fixed user marks updating.
This commit is contained in:
parent
94b0cfac7c
commit
d615f042fb
5 changed files with 10 additions and 18 deletions
|
@ -26,19 +26,19 @@ void UserMarkGenerator::ClearUserMarks(GroupID groupId)
|
|||
UpdateLinesIndex(groupId);
|
||||
}
|
||||
|
||||
void UserMarkGenerator::SetUserMarks(uint32_t groupId, drape_ptr<UserMarksRenderCollection> && marks)
|
||||
void UserMarkGenerator::SetUserMarks(GroupID groupId, drape_ptr<UserMarksRenderCollection> && marks)
|
||||
{
|
||||
m_marks.insert(std::make_pair(groupId, std::move(marks)));
|
||||
m_marks[groupId] = std::move(marks);
|
||||
UpdateMarksIndex(groupId);
|
||||
}
|
||||
|
||||
void UserMarkGenerator::SetUserLines(uint32_t groupId, drape_ptr<UserLinesRenderCollection> && lines)
|
||||
void UserMarkGenerator::SetUserLines(GroupID groupId, drape_ptr<UserLinesRenderCollection> && lines)
|
||||
{
|
||||
m_lines.insert(std::make_pair(groupId, std::move(lines)));
|
||||
m_lines[groupId] = std::move(lines);
|
||||
UpdateLinesIndex(groupId);
|
||||
}
|
||||
|
||||
void UserMarkGenerator::UpdateMarksIndex(uint32_t groupId)
|
||||
void UserMarkGenerator::UpdateMarksIndex(GroupID groupId)
|
||||
{
|
||||
for (auto & tileGroups : m_marksIndex)
|
||||
{
|
||||
|
@ -65,7 +65,7 @@ void UserMarkGenerator::UpdateMarksIndex(uint32_t groupId)
|
|||
CleanIndex();
|
||||
}
|
||||
|
||||
void UserMarkGenerator::UpdateLinesIndex(uint32_t groupId)
|
||||
void UserMarkGenerator::UpdateLinesIndex(GroupID groupId)
|
||||
{
|
||||
for (auto & tileGroups : m_marksIndex)
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace df
|
||||
{
|
||||
using GroupID = uint32_t;
|
||||
using GroupID = size_t;
|
||||
using MarkGroups = std::map<GroupID, drape_ptr<UserMarksRenderCollection>>;
|
||||
using LineGroups = std::map<GroupID, drape_ptr<UserLinesRenderCollection>>;
|
||||
|
||||
|
|
|
@ -6,20 +6,14 @@ df::UserMarksProvider::UserMarksProvider()
|
|||
{
|
||||
}
|
||||
|
||||
void df::UserMarksProvider::BeginRead()
|
||||
{
|
||||
Lock();
|
||||
}
|
||||
|
||||
bool df::UserMarksProvider::IsDirty() const
|
||||
{
|
||||
return m_isDirty;
|
||||
}
|
||||
|
||||
void df::UserMarksProvider::EndRead()
|
||||
void df::UserMarksProvider::ResetDirty()
|
||||
{
|
||||
m_isDirty = false;
|
||||
Unlock();
|
||||
}
|
||||
|
||||
void df::UserMarksProvider::IncrementCounter()
|
||||
|
|
|
@ -43,8 +43,6 @@ public:
|
|||
UserMarksProvider();
|
||||
virtual ~UserMarksProvider() {}
|
||||
|
||||
void BeginRead();
|
||||
|
||||
bool IsDirty() const;
|
||||
virtual bool IsDrawable() const = 0;
|
||||
|
||||
|
@ -56,8 +54,6 @@ public:
|
|||
/// never store UserLineMark reference
|
||||
virtual UserLineMark const * GetUserLineMark(size_t index) const = 0;
|
||||
|
||||
void EndRead();
|
||||
|
||||
void IncrementCounter();
|
||||
void DecrementCounter();
|
||||
bool CanBeDeleted();
|
||||
|
@ -67,6 +63,7 @@ public:
|
|||
protected:
|
||||
void BeginWrite();
|
||||
void SetDirty();
|
||||
void ResetDirty();
|
||||
void EndWrite();
|
||||
|
||||
private:
|
||||
|
|
|
@ -134,6 +134,7 @@ void UserMarkContainer::ReleaseController()
|
|||
engine->ClearUserMarksLayer(layerId);
|
||||
else
|
||||
engine->UpdateUserMarksLayer(layerId, this);
|
||||
ResetDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue