Skip to content

Commit

Permalink
fixing editor jumping around
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-eschmann committed Jul 4, 2024
1 parent 74b3f56 commit 274ab80
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/bottleneck/init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function init(canvas, parameters, options){
export async function init(canvas, parameters, options){
// Simply saving the context for 2D environments
return {
ctx: canvas.getContext('2d')
Expand Down
2 changes: 1 addition & 1 deletion examples/bottleneck/render.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function render(ui_state, parameters, state, action) {
export async function render(ui_state, parameters, state, action) {
const ctx = ui_state.ctx
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
const canvasWidth = ctx.canvas.width;
Expand Down
2 changes: 1 addition & 1 deletion examples/pendulum-simple/init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function init(canvas, parameters, options){
export async function init(canvas, parameters, options){
// Simply saving the context for 2D environments
return {
ctx: canvas.getContext('2d')
Expand Down
2 changes: 1 addition & 1 deletion examples/pendulum-simple/render.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function render(ui_state, parameters, state, action) {
export async function render(ui_state, parameters, state, action) {
const ctx = ui_state.ctx
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);

Expand Down
2 changes: 1 addition & 1 deletion examples/pendulum/init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function init(canvas, parameters, options){
export async function init(canvas, parameters, options){
// Simply saving the context for 2D environments
return {
ctx: canvas.getContext('2d')
Expand Down
2 changes: 1 addition & 1 deletion examples/pendulum/render.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function render(ui_state, parameters, state, action) {
export async function render(ui_state, parameters, state, action) {
const ctx = ui_state.ctx
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);

Expand Down
2 changes: 1 addition & 1 deletion external/ace-builds
3 changes: 3 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ body {
resize: vertical;
box-sizing: border-box;
}
.editor{
max-height: 90vh;
}

textarea:focus {
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* Slightly larger shadow on focus for a subtle effect */
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ window.addEventListener('load', () => {
const numberOfRows = Math.max(3, editor.session.getLength());
const newHeight = numberOfRows * rowHeight;
editorContainer.style.height = `${newHeight}px`;
editorContainer.style.maxHeight = `90vh`;
editor.resize();
}

Expand Down

0 comments on commit 274ab80

Please sign in to comment.