@@ -342,9 +342,11 @@ public void setFocused(@Nullable Element focused) {
342
342
}
343
343
344
344
public void scrollToFocused () {
345
- int index = indexedWidgets .indexOf (this .getFocused ());
346
- int itemsOnScreen = this .height / this .itemHeight ;
347
- this .setScrollAmount ((index - itemsOnScreen / 2.0 ) * this .itemHeight );
345
+ if (this .getFocused () instanceof CommandWidget focusedWidget ) {
346
+ int index = indexedWidgets .indexOf (focusedWidget );
347
+ int itemsOnScreen = this .height / this .itemHeight ;
348
+ this .setScrollAmount ((index - itemsOnScreen / 2.0 ) * this .itemHeight );
349
+ }
348
350
}
349
351
}
350
352
@@ -506,13 +508,13 @@ public void render(DrawContext context, int index, int y, int x, int entryWidth,
506
508
if (this .isFocused ()) {
507
509
CalciteCommandScreen .this .commandSuggestorRenderer = () -> {
508
510
context .getMatrices ().push ();
509
- context .getMatrices ().translate (0 , 0 , 1 );
511
+ context .getMatrices ().translate (3 , 0 , 1 );
510
512
ChatInputSuggestor .SuggestionWindow window = ((ChatInputSuggestorFields ) this .commandSuggestor ).getWindow ();
511
513
if (window != null ) {
512
514
((SuggestionWindowFields ) window ).getArea ().setY (calculateSuggestionY (y ));
513
515
}
514
516
if (!this .commandSuggestor .tryRenderWindow (context , mouseX , mouseY )) {
515
- context .getMatrices ().translate (0 , calculateMessageY (y ), 0 );
517
+ context .getMatrices ().translate (- 3 , calculateMessageY (y ), 0 );
516
518
this .commandSuggestor .renderMessages (context );
517
519
}
518
520
context .getMatrices ().pop ();
0 commit comments