Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rendering_system to enable absolute positioning of view hierarchy wireframe #83292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion static/app/components/events/viewHierarchy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function ViewHierarchy({viewHierarchy, project}: ViewHierarchyProps) {
hierarchy={hierarchy}
selectedNode={userHasSelected ? selectedNode : undefined}
onNodeSelect={onWireframeNodeSelect}
project={project}
system={viewHierarchy.rendering_system}
/>
</Right>
)}
Expand Down
9 changes: 4 additions & 5 deletions static/app/components/events/viewHierarchy/wireframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import {IconAdd, IconSubtract} from 'sentry/icons';
import {t} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import type {Project} from 'sentry/types/project';
import {getCenterScaleMatrixFromConfigPosition} from 'sentry/utils/profiling/gl/utils';
import type {Rect} from 'sentry/utils/profiling/speedscope';

Expand All @@ -29,11 +28,11 @@ export interface ViewNode {
type WireframeProps = {
hierarchy: ViewHierarchyWindow[];
onNodeSelect: (node?: ViewHierarchyWindow) => void;
project: Project;
system: string;
selectedNode?: ViewHierarchyWindow;
};

function Wireframe({hierarchy, selectedNode, onNodeSelect, project}: WireframeProps) {
function Wireframe({hierarchy, selectedNode, onNodeSelect, system}: WireframeProps) {
const theme = useTheme();
const [canvasRef, setCanvasRef] = useState<HTMLCanvasElement | null>(null);
const [overlayRef, setOverlayRef] = useState<HTMLCanvasElement | null>(null);
Expand All @@ -50,9 +49,9 @@ function Wireframe({hierarchy, selectedNode, onNodeSelect, project}: WireframePr
() =>
getHierarchyDimensions(
hierarchy,
['flutter', 'dart-flutter'].includes(project?.platform ?? '')
system === 'flutter' || system.includes('absolute')
),
[hierarchy, project.platform]
[hierarchy, system]
);
const nodeLookupMap = useMemo(() => {
const map = new Map<ViewHierarchyWindow, ViewNode>();
Expand Down
Loading