Skip to content

Commit f7da8cd

Browse files
committed
Made text input larger
1 parent d37dd49 commit f7da8cd

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/graphics/ui.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <transformer/transformer.h>
44
#include <graphics/graphics.h>
55
#include <string>
6+
#include <iostream>
67

78
using string = std::string;
89
using glm::vec2;
@@ -20,6 +21,7 @@ int input_text_callback(ImGuiInputTextCallbackData* data) {
2021
}
2122

2223

24+
2325
void render(FunctionState& state, unsigned int& op_tex, unsigned int& const_tex) {
2426
try {
2527
vector<TokenOperator> stack = parser::parse(state.expression);
@@ -41,6 +43,7 @@ void render(FunctionState& state, unsigned int& op_tex, unsigned int& const_tex)
4143
void render_and_update(FunctionState& state, unsigned int& op_tex, unsigned int& const_tex){
4244
ImGui::Begin("Function editor");
4345
ImGui::Text("Enter a complex function f(z)=");
46+
ImGui::SetNextItemWidth(-FLT_MIN);
4447
bool typed = ImGui::InputText("##source",
4548
static_cast<char*>(state.expression.data()),
4649
state.expression.capacity() + 1,
@@ -51,6 +54,7 @@ void render_and_update(FunctionState& state, unsigned int& op_tex, unsigned int&
5154
state.last_typing_time = glfwGetTime();
5255
state.needs_reparse = true;
5356
}
57+
5458
const float current_time = glfwGetTime();
5559
const float time_dif = current_time - state.last_typing_time;
5660
if (state.needs_reparse && time_dif < DEBOUNCE_DELAY) {

‎src/graphics/ui_init.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ void init_imgui(GLFWwindow* window) {
44
IMGUI_CHECKVERSION();
55
ImGui::CreateContext();
66
ImGuiIO& io = ImGui::GetIO();
7+
io.FontGlobalScale = 2.0f;
78
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
89
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
910
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;

0 commit comments

Comments
 (0)