Review fixes

This commit is contained in:
r.kuznetsov 2018-05-22 13:38:33 +03:00 committed by Daria Volvenkova
parent 57f02e95bf
commit dc66e95b91
7 changed files with 24 additions and 26 deletions

View file

@ -92,15 +92,8 @@ public class MapFragment extends BaseMwmFragment
sWasCopyrightDisplayed = true;
}
nativeSetupWidget(WIDGET_RULER,
UiUtils.dimen(R.dimen.margin_ruler_left),
mHeight - UiUtils.dimen(R.dimen.margin_ruler_bottom),
ANCHOR_LEFT_BOTTOM);
nativeSetupWidget(WIDGET_WATERMARK,
UiUtils.dimen(R.dimen.margin_watermark_right),
mHeight - UiUtils.dimen(R.dimen.margin_watermark_bottom),
ANCHOR_RIGHT_BOTTOM);
setupRuler(0, false);
setupWatermark(0, false);
if (BuildConfig.DEBUG)
{
@ -126,20 +119,20 @@ public class MapFragment extends BaseMwmFragment
nativeApplyWidgets();
}
void setupRuler(int offsetX, int offsetY, boolean forceRedraw)
void setupRuler(int offsetY, boolean forceRedraw)
{
nativeSetupWidget(WIDGET_RULER,
UiUtils.dimen(R.dimen.margin_ruler_left) + offsetX,
UiUtils.dimen(R.dimen.margin_ruler_left),
mHeight - UiUtils.dimen(R.dimen.margin_ruler_bottom) + offsetY,
ANCHOR_LEFT_BOTTOM);
if (forceRedraw && mContextCreated)
nativeApplyWidgets();
}
void setupWatermark(int offsetX, int offsetY, boolean forceRedraw)
void setupWatermark(int offsetY, boolean forceRedraw)
{
nativeSetupWidget(WIDGET_WATERMARK,
UiUtils.dimen(R.dimen.margin_watermark_right) + offsetX,
mWidth - UiUtils.dimen(R.dimen.margin_watermark_right),
mHeight - UiUtils.dimen(R.dimen.margin_watermark_bottom) + offsetY,
ANCHOR_RIGHT_BOTTOM);
if (forceRedraw && mContextCreated)

View file

@ -1539,7 +1539,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
public void run()
{
final int menuHeight = menu.getFrame().getHeight();
adjustBottomWidgets(0, menuHeight);
adjustBottomWidgets(menuHeight);
mIsFullscreenAnimating = false;
if (mIsAppearMenuLater)
@ -1573,7 +1573,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void run()
{
adjustBottomWidgets(0, 0);
adjustBottomWidgets(0);
}
});
if (mNavMyPosition != null)
@ -1762,13 +1762,13 @@ public class MwmActivity extends BaseMwmFragmentActivity
MapFragment.nativeCompassUpdated(compass.getMagneticNorth(), compass.getTrueNorth(), true);
}
private void adjustBottomWidgets(int offsetX, int offsetY)
private void adjustBottomWidgets(int offsetY)
{
if (mMapFragment == null || !mMapFragment.isAdded())
return;
mMapFragment.setupRuler(offsetX, offsetY, true);
mMapFragment.setupWatermark(offsetX, offsetY, true);
mMapFragment.setupRuler(offsetY, false);
mMapFragment.setupWatermark(offsetY, true);
}
@Override
@ -1855,7 +1855,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
public void run()
{
final int menuHeight = getCurrentMenu().getFrame().getHeight();
adjustBottomWidgets(0, menuHeight);
adjustBottomWidgets(menuHeight);
if (completion != null)
completion.run();
}
@ -1957,7 +1957,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void run()
{
adjustBottomWidgets(0, 0);
adjustBottomWidgets(0);
}
});
}

View file

@ -67,7 +67,9 @@ public:
StaticVertex() = default;
StaticVertex(glsl::vec3 const & position, glsl::vec2 const & color,
glsl::vec2 const & outlineColor)
: m_position(position), m_color(color), m_outline(outlineColor)
: m_position(position)
, m_color(color)
, m_outline(outlineColor)
{}
static dp::BindingInfo const & GetBindingInfo();
@ -81,7 +83,8 @@ public:
{
DynamicVertex() = default;
DynamicVertex(glsl::vec2 const & normal, glsl::vec2 const & mask)
: m_normal(normal), m_maskTexCoord(mask)
: m_normal(normal)
, m_maskTexCoord(mask)
{}
static dp::BindingInfo const & GetBindingInfo();

View file

@ -230,7 +230,7 @@ drape_ptr<LayerRenderer> LayerCacher::RecacheDebugLabels(ref_ptr<dp::TextureMana
{
drape_ptr<LayerRenderer> renderer = make_unique_dp<LayerRenderer>();
float const vs = static_cast<float>(df::VisualParams::Instance().GetVisualScale());
auto const vs = static_cast<float>(df::VisualParams::Instance().GetVisualScale());
DebugInfoLabels debugLabels = DebugInfoLabels(Position(m2::PointF(10.0f * vs, 50.0f * vs), dp::Center));
debugLabels.AddLabel(textures, "visible: km2, readed: km2, ratio:",

View file

@ -21,7 +21,9 @@ struct RulerVertex
{
RulerVertex() = default;
RulerVertex(glsl::vec2 const & pos, glsl::vec2 const & normal, glsl::vec2 const & texCoord)
: m_position(pos), m_normal(normal), m_texCoord(texCoord)
: m_position(pos)
, m_normal(normal)
, m_texCoord(texCoord)
{}
glsl::vec2 m_position;

View file

@ -101,7 +101,7 @@ double Identity(double val)
} // namespace
RulerHelper::RulerHelper()
: m_pixelLength(0.0)
: m_pixelLength(0.0f)
, m_rangeIndex(kInvalidUnitValue)
, m_isTextDirty(false)
, m_dirtyTextRequested(false)

View file

@ -35,7 +35,7 @@ public:
{
SetIsVisible(true);
m2::PointD halfSize(0.5 * size.x , 0.5 * size.y);
m2::PointF const halfSize(0.5f * size.x , 0.5f * size.y);
m_offset = glsl::vec2(0.0f, 0.0f);
if (anchor & dp::Left)