diff options
author | George Hazan <ghazan@miranda.im> | 2017-10-31 17:03:12 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-10-31 17:03:12 +0300 |
commit | e667e034f103a17e8cf37689ea2de762f49704c2 (patch) | |
tree | b39eba4e89914f2a451a37652db6a4637f4ea9bb /plugins/SmileyAdd/src/SmileyBase.cpp | |
parent | 4d9bf8032dd659e091394d688b6a2c59bf222240 (diff) |
fix for drawing half-visible smileys
Diffstat (limited to 'plugins/SmileyAdd/src/SmileyBase.cpp')
-rw-r--r-- | plugins/SmileyAdd/src/SmileyBase.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/plugins/SmileyAdd/src/SmileyBase.cpp b/plugins/SmileyAdd/src/SmileyBase.cpp index 583396fbe7..2749923e6f 100644 --- a/plugins/SmileyAdd/src/SmileyBase.cpp +++ b/plugins/SmileyAdd/src/SmileyBase.cpp @@ -110,26 +110,26 @@ void ISmileyBase::SetHint(wchar_t *smltxt) void ISmileyBase::SetPosition(HWND hwnd, LPCRECT lpRect)
{
m_hwnd = hwnd;
- if (lpRect == NULL || (lpRect->top == -1 && lpRect->bottom == -1)) {
+ if (lpRect == NULL || lpRect->top == -1 || lpRect->bottom == -1) {
m_visible = false;
+ return;
+ }
+
+ m_visible = true;
+ m_dirAniAllow = true;
+ m_orect.left = lpRect->left;
+ m_orect.right = lpRect->left + m_sizeExtent.cx;
+ if (lpRect->top == -1) {
+ m_orect.top = lpRect->bottom - m_sizeExtent.cy;
+ m_orect.bottom = lpRect->bottom;
+ }
+ else if (lpRect->bottom == -1) {
+ m_orect.top = lpRect->top;
+ m_orect.bottom = lpRect->top + m_sizeExtent.cy;
}
else {
- m_visible = true;
- m_dirAniAllow = true;
- m_orect.left = lpRect->left;
- m_orect.right = lpRect->left + m_sizeExtent.cx;
- if (lpRect->top == -1) {
- m_orect.top = lpRect->bottom - m_sizeExtent.cy;
- m_orect.bottom = lpRect->bottom;
- }
- else if (lpRect->bottom == -1) {
- m_orect.top = lpRect->top;
- m_orect.bottom = lpRect->top + m_sizeExtent.cy;
- }
- else {
- m_orect.top = lpRect->bottom - m_sizeExtent.cy;
- m_orect.bottom = lpRect->bottom;
- }
+ m_orect.top = lpRect->bottom - m_sizeExtent.cy;
+ m_orect.bottom = lpRect->bottom;
}
}
|