Fix editor text box offset.

This commit is contained in:
Curle 2021-06-19 20:04:29 +01:00
parent 68e2b25a78
commit 40d6fbd17c
Signed by: TheCurle
GPG Key ID: 5942F13718443F79

View File

@ -1,4 +1,5 @@
#include <kernel/chroma.h>
#include <kernel/system/driver/keyboard.h>
#include <kernel/video/draw.h>
#include <editor/main.h>
@ -10,10 +11,10 @@
/**
* Contains startup and setup routines for the Chroma Editor.
*/
static int KernelID;
static KeyboardCallback KernelHandler;
void StartEditor(int callbackID) {
KernelID = callbackID;
KernelHandler = KeyboardCallbacks[callbackID];
struct EditorLayout layout = (struct EditorLayout) {0};
layout.ScreenHeight = PrintInfo.screenHeight;
@ -21,7 +22,7 @@ void StartEditor(int callbackID) {
layout.HeaderHeight = layout.ScreenHeight / 100 * 3;
layout.TextBoxHeight = (layout.ScreenHeight - layout.HeaderHeight) / 100 * 95;
layout.TextBoxY = ((layout.ScreenHeight + - layout.HeaderHeight) - layout.TextBoxHeight) / 2;
layout.TextBoxY = ((layout.ScreenHeight + layout.HeaderHeight) - layout.TextBoxHeight) / 2;
layout.TextBoxWidth = layout.ScreenWidth / 100 * 95;
layout.TextBoxX = (layout.ScreenWidth - layout.TextBoxWidth) / 2;