MCPcopy Create free account
hub / github.com/comaps/comaps / GetProperty

Method GetProperty

libs/drape_frontend/animation/scale_animation.cpp:91–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91bool MapScaleAnimation::GetProperty(Object object, ObjectProperty property, bool targetValue,
92 PropertyValue & value) const
93{
94 ASSERT_EQUAL(static_cast<int>(object), static_cast<int>(Animation::Object::MapPlane), ());
95
96 if (property == Animation::ObjectProperty::Position)
97 {
98 ScreenBase screen = AnimationSystem::Instance().GetLastScreen();
99 screen.SetScale(targetValue ? m_scaleInterpolator.GetTargetScale() : m_scaleInterpolator.GetScale());
100 m2::PointD const pixelOffset = screen.PixelRect().Center() - screen.P3dtoP(m_pxScaleCenter);
101 value = PropertyValue(screen.PtoG(screen.GtoP(m_globalScaleCenter) + pixelOffset));
102 return true;
103 }
104 if (property == Animation::ObjectProperty::Scale)
105 {
106 value = PropertyValue(targetValue ? m_scaleInterpolator.GetTargetScale() : m_scaleInterpolator.GetScale());
107 return true;
108 }
109 ASSERT(false, ("Wrong property:", static_cast<int>(property)));
110 return false;
111}
112
113bool MapScaleAnimation::GetTargetProperty(Object object, ObjectProperty property, PropertyValue & value) const
114{

Callers

nothing calls this directly

Calls 9

PropertyValueClass · 0.85
ASSERTFunction · 0.85
GetTargetScaleMethod · 0.80
SetScaleMethod · 0.45
GetScaleMethod · 0.45
CenterMethod · 0.45
P3dtoPMethod · 0.45
PtoGMethod · 0.45
GtoPMethod · 0.45

Tested by

no test coverage detected