Skip to content
Merged
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
10 changes: 6 additions & 4 deletions src/components/editor/ImageInsertOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,13 @@ export function ImageInsertOverlay({
const animatedStyle = useAnimatedStyle(() => ({
left: screenLeft,
top: screenTop,
width: width.value * pageScale,
height: height.value * pageScale,
// InfiniteInkCanvas already transforms this overlay with the page. Keep
// its layout in page units; pageScale is for screen-space gesture deltas.
width: width.value,
height: height.value,
transform: [
{ translateX: x.value * pageScale },
{ translateY: y.value * pageScale },
{ translateX: x.value },
{ translateY: y.value },
{ rotate: `${rotation.value}deg` },
],
}));
Expand Down
13 changes: 8 additions & 5 deletions src/components/editor/TextBoxOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,16 +323,19 @@ export function TextBoxOverlay({
const animatedStyle = useAnimatedStyle(() => ({
left: screenLeft,
top: screenTop,
width: width.value * pageScale,
height: height.value * pageScale,
// OverlayLayer is rendered inside InfiniteInkCanvas's transformed viewport.
// Positions and dimensions here must remain in page units; pageScale is only
// used above to translate screen-space gesture deltas back to page units.
width: width.value,
height: height.value,
transform: [
{ translateX: x.value * pageScale },
{ translateY: y.value * pageScale },
{ translateX: x.value },
{ translateY: y.value },
{ scale: isDragging.value || isResizing.value ? 1.02 : 1 },
],
}));

const fontSize = (textBox.fontSize ?? 18) * pageScale;
const fontSize = textBox.fontSize ?? 18;
const color = textBox.color || theme.colors.text;
const showChrome = isSelected || isEditing;

Expand Down
Loading