Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2022 jMonkeyEngine
* Copyright (c) 2009-2023 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -40,6 +40,7 @@
import com.jme3.input.event.KeyInputEvent;
import com.jme3.post.SceneProcessor;
import com.jme3.profile.AppProfiler;
import com.jme3.renderer.Camera;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.Renderer;
import com.jme3.renderer.ViewPort;
Expand Down Expand Up @@ -321,7 +322,12 @@ public void initialize(RenderManager rm, ViewPort vp) {
this.renderer = rm.getRenderer();

inputSys.reset();
inputSys.setHeight(vp.getCamera().getHeight());

// window size may have changed since the private initialize() above
Camera camera = vp.getCamera();
this.w = camera.getWidth();
this.h = camera.getHeight();
inputSys.setHeight(h);
}

public Nifty getNifty() {
Expand Down