aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index 45d386436..486c941e9 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -344,7 +344,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
@action
static restoreTargetDocView(bestTargetView: Opt<DocumentView>, activeItem: Doc, transTime: number, pinDocLayout: boolean = BoolCast(activeItem.presPinLayout), pinDataTypes?: pinDataTypes, targetDoc?: Doc) {
const bestTarget = bestTargetView?.rootDoc ?? (targetDoc?.unrendered ? DocCast(targetDoc?.annotationOn) : targetDoc);
- if (!bestTarget) return;
+ if (!bestTarget || activeItem === bestTarget) return;
let changed = false;
if (pinDocLayout) {
if (
@@ -385,6 +385,14 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
Doc.GetProto(bestTarget).color = activeItem.color;
changed = true;
}
+ if (bestTarget.width !== activeItem.width) {
+ bestTarget._width = NumCast(activeItem.presWidth, NumCast(bestTarget.width));
+ changed = true;
+ }
+ if (bestTarget.height !== activeItem.height) {
+ bestTarget._height = NumCast(activeItem.presHeight, NumCast(bestTarget.height));
+ changed = true;
+ }
}
if ((pinDataTypes?.viewType && activeItem.presPinViewType !== undefined) || (!pinDataTypes && activeItem.presPinViewType !== undefined)) {
if (bestTarget._viewType !== activeItem.presPinViewType) {
@@ -535,6 +543,8 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
if (pinProps.pinData.inkable) {
pinDoc.presFillColor = targetDoc.fillColor;
pinDoc.presColor = targetDoc.color;
+ pinDoc.presWidth = targetDoc._width;
+ pinDoc.presHeight = targetDoc._height;
}
if (pinProps.pinData.scrollable) pinDoc.presPinViewScroll = targetDoc._scrollTop;
if (pinProps.pinData.clippable) pinDoc.presPinClipWidth = targetDoc._clipWidth;