JSB export math class : Vec2/Vec3/Vec4/Quat/Mat3/Mat4/Color (#12968)

This commit is contained in:
江战
2022-10-31 17:24:54 +08:00
committed by GitHub
parent 118ab30e39
commit 7ccd14e6e6
21 changed files with 1615 additions and 3514 deletions
+2 -2
View File
@@ -243,12 +243,12 @@ void EditBox::show(const EditBox::ShowInfo &showInfo) {
RECT rect;
GetWindowRect(getCurrentWindowHwnd(), &rect);
float WindowRatio = (float)(rect.bottom - rect.top) / (float)CC_GET_PLATFORM_INTERFACE(ISystemWindow)->getViewSize().y;
float WindowRatio = (float)(rect.bottom - rect.top) / (float)CC_GET_PLATFORM_INTERFACE(ISystemWindow)->getViewSize().height;
float JsFontRatio = float(showInfo.fontSize) / 5;
/** A probale way to calculate the increase of font size
* OriginalSize + Increase = OriginalSize * Ratio_of_js_fontSize * Ratio_of_window
* Default value : OriginalSize = 8, Ratio_of_js_fontSize = showInfo.fontSize /5,
* Ratio_of_window = (float)height / (float)CC_GET_PLATFORM_INTERFACE(ISystemWindow)->getViewSize().y
* Ratio_of_window = (float)height / (float)CC_GET_PLATFORM_INTERFACE(ISystemWindow)->getViewSize().height
* thus Increase was calculated.
*/
int fsize = (float)(JsFontRatio + 8) * WindowRatio - 8;