Skip to content

Commit 13a951c

Browse files
fix: swap width and height parameters in Application constructor
1 parent 514538f commit 13a951c

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

examples/shapes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import {Application, Rectangle, Vector2, Palette } from "vectorjs";
22

3-
const screenWidth = 800;
4-
const screenHeight = 600;
3+
const screenWidth = 600;
4+
const screenHeight = 800;
55
const fpsPos = new Vector2(10, 10);
66
const rect = new Rectangle(30, 30, 200, 45);
77
const point1 = new Vector2(400, 150);
88
const point2 = new Vector2(300, 350);
99
const point3 = new Vector2(500, 350);
1010

11-
const app = new Application(screenHeight, screenWidth, "Window");
11+
const app = new Application(screenWidth, screenHeight,"Window");
1212
app.run({
1313

1414
onDraw(render) {

examples/text.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {Application, Rectangle, Vector2, Palette, Font} from "vectorjs";
22

3-
const screenWidth = 800;
4-
const screenHeight = 600;
3+
const screenWidth = 600;
4+
const screenHeight = 800;
55
const fpsPos = new Vector2(10, 10);
66
const origin = new Vector2(0, 0);
77

8-
const app = new Application(screenHeight, screenWidth, "Window");
8+
const app = new Application(screenWidth, screenHeight,"Window");
99
app.run({
1010

1111
onInit() {

src/api/hostapi.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace HostApi {
8080

8181
class JSApplication {
8282
public:
83-
JSApplication(int h, int w, const std::string& title);
83+
JSApplication(int w, int h, const std::string& title);
8484
void Run(const qjs::Value& user_app);
8585
};
8686

src/vectorjs.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ declare module "vectorjs" {
140140
* Core Application wrapper executing the rendering pipeline.
141141
*/
142142
export class Application {
143-
constructor(height: number, width: number, title: string);
143+
constructor(width: number, height: number, title: string);
144144
run(userApp: UserApplication): void;
145145
}
146146

0 commit comments

Comments
 (0)