このコミットが含まれているのは:
守矢諏訪子 2024-05-02 18:36:43 +09:00
コミット 3bb0f66e0b
1個のファイルの変更2行の追加2行の削除

4
main.c
ファイルの表示

@ -61,7 +61,7 @@ void windowevent(SDL_Event e) {
float newAspectRatio = (float)newWidth / newHeight;
int scaledWidth, scaledHeight;
if (newAspectRatio != aspectRatio) {
// 画像よりウィンドウの方が広い場合
// 画像よりウィンドウの方が広い場合
scaledHeight = newHeight;
scaledWidth = (int)(scaledHeight * aspectRatio);
} else {
@ -78,7 +78,7 @@ void windowevent(SDL_Event e) {
// 大きすぎの場合もふざけんな
if (scaledWidth >= (screenWidth-20)) scaledWidth = screenWidth-20;
if (scaledHeight >= (screenHeight-20)) scaledWidth = screenHeight-20;
if (scaledHeight >= (screenHeight-20)) scaledHeight = screenHeight-20;
// テキスチャーのれんダーリングサイズの設定
SDL_Rect renderQuad = { imgWidth, imgHeight, scaledWidth, scaledHeight };