mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-06 11:31:59 +08:00
JSB export math class : Vec2/Vec3/Vec4/Quat/Mat3/Mat4/Color (#12968)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user