diff options
author | hschang <chang@dev3> | 2017-08-21 07:18:36 (GMT) |
---|---|---|
committer | hschang <chang@dev3> | 2017-08-21 07:18:36 (GMT) |
commit | 7963a66b2debe9cf6ae566cb88511fdfdc9dc216 (patch) | |
tree | 8ac4bb2338a409e8e62f71e5a4ceb5d94fba3b5a /lib/gui/evideo.cpp | |
parent | dd4c8249ef0b08234b6239da9bef26ed7e33ac78 (diff) |
Add QuadPiP plugin.
Diffstat (limited to 'lib/gui/evideo.cpp')
-rw-r--r-- | lib/gui/evideo.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/gui/evideo.cpp b/lib/gui/evideo.cpp index 745571d..f5876e9 100644 --- a/lib/gui/evideo.cpp +++ b/lib/gui/evideo.cpp @@ -30,7 +30,7 @@ void setFullsize() } eVideoWidget::eVideoWidget(eWidget *parent) - :eLabel(parent), m_fb_size(720, 576), m_state(0), m_decoder(1) + :eLabel(parent), m_fb_size(720, 576), m_state(0), m_decoder(1), m_adjust_position(true) { if (!fullsizeTimer) { @@ -118,14 +118,17 @@ void eVideoWidget::updatePosition(int disable) int width = pos.width() * 720 / m_fb_size.width(); int height = pos.height() * 576 / m_fb_size.height(); - int tmp = left - (width * 4) / 100; - left = tmp < 0 ? 0 : tmp; - tmp = top - (height * 4) / 100; - top = tmp < 0 ? 0 : tmp; - tmp = (width * 108) / 100; - width = left + tmp > 720 ? 720 - left : tmp; - tmp = (height * 108) / 100; - height = top + tmp > 576 ? 576 - top : tmp; + if (m_adjust_position) + { + int tmp = left - (width * 4) / 100; + left = tmp < 0 ? 0 : tmp; + tmp = top - (height * 4) / 100; + top = tmp < 0 ? 0 : tmp; + tmp = (width * 108) / 100; + width = left + tmp > 720 ? 720 - left : tmp; + tmp = (height * 108) / 100; + height = top + tmp > 576 ? 576 - top : tmp; + } // eDebug("picture recalced %d %d -> %d %d", left, top, width, height); @@ -172,3 +175,9 @@ void eVideoWidget::setDecoder(int decoder) { m_decoder = decoder; } + +void eVideoWidget::setAdjustPosition(bool value) +{ + m_adjust_position = value; +} + |