summaryrefslogtreecommitdiff
diff options
authorNick Dedekind <nick.dedekind@canonical.com>2017-04-18 17:28:13 +0100
committerNick Dedekind <nick.dedekind@canonical.com>2017-04-18 17:28:13 +0100
commit0091bdbf1c71fa0319155e342aae8709103fc7c4 (patch)
tree65a0b68cf651fbd8d1f07356d902dcdcbd210989
parent52784a352ec43729fa65c3784f927fad30f14f23 (diff)
_left_size already has dpi scaling included
(bzr r4228.2.1)
-rw-r--r--launcher/Tooltip.cpp10
-rw-r--r--launcher/Tooltip.h3
2 files changed, 6 insertions, 7 deletions
diff --git a/launcher/Tooltip.cpp b/launcher/Tooltip.cpp
index e7a0f8341..ac1406268 100644
--- a/launcher/Tooltip.cpp
+++ b/launcher/Tooltip.cpp
@@ -124,13 +124,13 @@ int Tooltip::CalculateX() const
{
int size = 0;
int max = GetBaseWidth() - ROTATED_ANCHOR_WIDTH.CP(cv_) - 2 * CORNER_RADIUS.CP(cv_) - 2 * _padding.CP(cv_);
- if (_left_size.CP(cv_) > max)
+ if (_left_size > max)
{
size = max;
}
- else if (_left_size.CP(cv_) > 0)
+ else if (_left_size > 0)
{
- size = _left_size.CP(cv_);
+ size = _left_size;
}
x = _anchorX - (ROTATED_ANCHOR_WIDTH.CP(cv_) / 2) - size - CORNER_RADIUS.CP(cv_) - _padding.CP(cv_);
}
@@ -653,7 +653,7 @@ void Tooltip::UpdateTexture()
height / dpi_scale,
anchor_width,
anchor_height,
- _left_size,
+ _left_size / dpi_scale,
CORNER_RADIUS,
blur_coef,
shadow_color,
@@ -669,7 +669,7 @@ void Tooltip::UpdateTexture()
CORNER_RADIUS, // radius,
anchor_width, // anchor_width,
anchor_height, // anchor_height,
- _left_size, // left_size,
+ _left_size / dpi_scale, // left_size,
true, // negative,
false, // outline,
1.0, // line_width,
diff --git a/launcher/Tooltip.h b/launcher/Tooltip.h
index 431180d6f..8841ae4f9 100644
--- a/launcher/Tooltip.h
+++ b/launcher/Tooltip.h
@@ -78,7 +78,7 @@ private:
int _anchorX;
int _anchorY;
- RawPixel _left_size; // size of the segment from point 10 to 11, used when launcher at bottom.
+ int _left_size; // size of the segment from point 10 to 11, used when launcher at bottom.
RawPixel _padding;
nux::HLayout* _hlayout;
@@ -94,4 +94,3 @@ private:
}
#endif // TOOLTIP_H
-