~ubuntu-branches/ubuntu/utopic/dvdstyler/utopic-proposed

« back to all changes in this revision

Viewing changes to src/MenuObject.cpp

  • Committer: Package Import Robot
  • Author(s): Fabrice Coutadeur
  • Date: 2012-12-15 18:58:57 UTC
  • mfrom: (1.1.16)
  • Revision ID: package-import@ubuntu.com-20121215185857-3fre4y6qzi1z4hcr
Tags: 2.3.4-0ubuntu1
* New upstream release
* debian/watch: updated to only get stable releases (and discard alpha and
  beta version)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
// Purpose:     The class to store a DVD Menu Object
4
4
// Author:      Alex Thuering
5
5
// Created:     04.11.2006
6
 
// RCS-ID:      $Id: MenuObject.cpp,v 1.41 2012/07/01 19:22:45 ntalex Exp $
 
6
// RCS-ID:      $Id: MenuObject.cpp,v 1.42 2012/10/14 14:58:19 ntalex Exp $
7
7
// Copyright:   (c) Alex Thuering
8
8
// Licence:     GPL
9
9
/////////////////////////////////////////////////////////////////////////////
357
357
                fy *= (double) m_menu->GetFrameResolution().GetHeight() / m_menu->GetResolution().GetHeight();
358
358
        int width = round(GetWidth()*fx);
359
359
        int height = round(GetHeight()*fy);
360
 
        if (width % 2 == 1)
361
 
                width++;
362
 
        if (height % 2 == 1)
363
 
                height++;
364
360
        int padY = mode == ssmLETTERBOX && !ignorePadding ? m_menu->GetFrameResolution().GetHeight()*0.125: 0;
365
361
        int cropX = mode == ssmPANSCAN ? m_menu->GetFrameResolution().GetWidth()*0.125 : 0;
366
 
        return wxRect(round((GetX() - cropX)*fx), round(GetY()*fy) + padY, width, height);
 
362
        int x = round((GetX() - cropX)*fx);
 
363
        int y = round(GetY()*fy) + padY;
 
364
        if (height % 2 == 1)
 
365
                height += y % 2 == 0 ? 1 : -1;
 
366
        if (y % 2 == 1)
 
367
                y++;
 
368
        return wxRect(x, y, width, height);
367
369
}
368
370
 
369
371
unsigned int MenuObject::CalcSize(MenuObjectSize& size, bool width) {