Changeset 1274 for cpp/common


Ignore:
Timestamp:
09/09/23 15:12:57 (15 months ago)
Author:
Maciej Komosinski
Message:

Cosmetic

Location:
cpp/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/2d.h

    r1130 r1274  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2023  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    99#include <algorithm>
    1010
    11 //unification of old GUIXY and Pt2D
    1211template <typename T> class XY
    1312{
     
    174173        }
    175174
     175        XYRect fillAspect(float aspect)
     176        {
     177                XYRect r;
     178                r.size = size;
     179                if (size.x < size.y * aspect)
     180                        r.size.x = r.size.y * aspect;
     181                else
     182                        r.size.y = r.size.x / aspect;
     183                r.p = p + (size - r.size) * 0.5;
     184                return r;
     185        }
     186       
    176187        XYRect intersection(const XYRect &r) const
    177188        {
  • cpp/common/Convert.cpp

    r1130 r1274  
    155155        wstring wstr;
    156156        int nOffset = 0;
    157         int nDataLen = strlen(str); //ending \0 is not converted, but resize() below sets the proper length of wstr
     157        int nDataLen = (int)strlen(str); //ending \0 is not converted, but resize() below sets the proper length of wstr
    158158        int nLenWide = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)(str + nOffset),
    159159                (int)(nDataLen - nOffset), NULL, 0);
Note: See TracChangeset for help on using the changeset viewer.