view horori/merger/src/utils.cpp @ 7:3b16a1b57e00 draft default tip

add qtuti/95y.
author pyon
date Sat, 27 Nov 2021 14:50:30 +0900
parents aaaa401818a1
children
line wrap: on
line source

// Filename   : utils.cpp
// Last Change: 2020-03-18  15:01:12.
//
#include <wx/wx.h>
#include "utils.h"

wxRect Geo2Rect(wxString geo)
{
    long w, h, x, y;
    wxString sw = geo.BeforeFirst('x');
    wxString sh = geo.AfterFirst('x').BeforeFirst('+');
    wxString sx = geo.AfterFirst('+').BeforeFirst('+');
    wxString sy = geo.AfterLast('+');

    sw.ToLong(&w, 10);
    sh.ToLong(&h, 10);
    sx.ToLong(&x, 10);
    sy.ToLong(&y, 10);

    return wxRect((int)x, (int)y, (int)w, (int)h);
}

wxRect ZeroRect()
{
	wxRect rect(wxPoint(0, 0), wxPoint(0, 0));
	return rect;
}