Skip to content

Commit

Permalink
Merge branch 'release/v1.2.0' of https://github.com/voxel51/fiftyone
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
voxel51-bot committed Dec 18, 2024
2 parents 888ad9d + c82bb81 commit d8b5a19
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion app/packages/core/src/components/Grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ function Grid() {
get: (next) => page(next),
render: (id, element, dimensions, zooming) => {
if (lookerStore.has(id.description)) {
lookerStore.get(id.description)?.attach(element, dimensions);
lookerStore
.get(id.description)
?.attach(element, dimensions, getFontSize());

return;
}

Expand Down
2 changes: 1 addition & 1 deletion app/packages/core/src/components/ImageContainerHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as fos from "@fiftyone/state";
import { isGroup as isGroupAtom } from "@fiftyone/state";
import { Apps, ImageAspectRatio } from "@mui/icons-material";
import Color from "color";
import { Suspense, useMemo } from "react";
import React, { Suspense, useMemo } from "react";
import {
constSelector,
useRecoilCallback,
Expand Down
10 changes: 8 additions & 2 deletions app/packages/looker/src/lookers/abstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,18 @@ export abstract class AbstractLooker<
/**
* Attaches the instance to the provided HTMLElement and adds event listeners
*/
attach(element: HTMLElement | string, dimensions?: Dimensions): void {
attach(
element: HTMLElement | string,
dimensions?: Dimensions,
fontSize?: number
): void {
if (typeof element === "string") {
element = document.getElementById(element);
}

if (element === this.lookerElement.element.parentElement) {
this.state.disabled && this.updater({ disabled: false });
this.state.disabled &&
this.updater({ disabled: false, options: { fontSize } });
return;
}

Expand All @@ -491,6 +496,7 @@ export abstract class AbstractLooker<
this.updater({
windowBBox: dimensions ? [0, 0, ...dimensions] : getElementBBox(element),
disabled: false,
options: { fontSize },
});
element.appendChild(this.lookerElement.element);
!dimensions && this.resizeObserver.observe(element);
Expand Down

0 comments on commit d8b5a19

Please sign in to comment.