Skip to content

Commit

Permalink
fix(TextBoundsParams): add RichText field
Browse files Browse the repository at this point in the history
  • Loading branch information
sasial-dev authored Jul 19, 2024
1 parent f967091 commit 7b7621c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/ui/src/components/suggestions/suggestions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ export function Suggestions() {
}, [terminalText]);

const textBoundsParams = useMemo(
() => new Instance("GetTextBoundsParams"),
() => {
const instance = new Instance("GetTextBoundsParams");
instance.RichText = true;
return instance
},
[],
);

Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/components/suggestions/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
import { SuggestionTextBounds } from "./types";

const TEXT_BOUNDS_PARAMS = new Instance("GetTextBoundsParams");
TEXT_BOUNDS_PARAMS.RichText = true;

const DEFAULT_BOUNDS = new Vector2();

let prevColor: Color3 | undefined;
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/components/terminal-window.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function TerminalWindow() {

const textBoundsParams = useMemo(() => {
const params = new Instance("GetTextBoundsParams");
params.RichText = true;
params.Width = math.huge;
params.Font = options.font.regular;
return params;
Expand Down

0 comments on commit 7b7621c

Please sign in to comment.