Today’s Picture of the Day image

image I haven’t actually wrapped the group div in a sticky div yet.

In the normal DOM, the position of the content is determined first, and then the size of the parent element is determined to wrap the content, so it was necessary to calculate the bounding box by oneself.

  • At any rate, I’ve confirmed that that bounding box calculation worked.

I set the center of the group to 0, thinking that the calculation of the displacement caused by DOM inclusions could be done later, but when I thought about it, the starting point of the position was the upper left corner of the parent element. image

Once the bounding box of the parent element is determined, we know the position of the starting point, so I guess we can propagate that to the child elements.

2021-07-02 I tested the chitin coordinates. image The group has not yet encompassed stickies. Group.tsx

<>
  <GroupDiv style={style} key={value.id} data-testid={value.id}></GroupDiv>
  {idsToDom(value.items, offset)}
</>

Inclusion will naturally lead to misalignment. image Group.tsx

<GroupDiv style={style} key={value.id} data-testid={value.id}>
  {idsToDom(value.items, offset)}
</GroupDiv>

If I change the offset to propagate here… hey, it looks right, but the test is rubbish, it’s off by 5px. image

I see, so it’s only the thickness of the border that’s displaced. image

safely restored to normal image


Import stiff complex groups from Regroup image image The drawing position of the contents is misaligned. This is due to, well, the difference in the way Regroup and Movidea have their coordinates. Regroup also has absolute coordinates for branch stickies, but Movidea’s coordinates are relative to the parent. I have to fix it only when importing from Regroup.

With the relative coordinate style, the coordinates of the child elements need to be rewritten when grouping. This is not necessary when dragging a group.

image Oh, and the sticky’s magnification feature was not yet implemented in the first place. Oh, and “group within a group” sounds odd. Let’s try something simpler to see if the import is wrong or the drawing is wrong.

scaled image It’s done.

nested image This is a crazy offset for a group within a group. image Cured.

I’ll check again. image Visibility in Regroup image It’s much better. Hey, isn’t this because the aspect ratio of the stickies and the margins of the groups are different in the first place?

Fixed. image Hmmm, this isn’t the same bounding box of stickies that expanded unrelated to the group’s nesting.

Minimized. image image Ah, I see, the height and width are reversed in the bounding box calculation.

image Hmmm, still a little funny. This is a compounding problem, so I think I’ll put aside importing from Regroup for now. This is going to be resolved in a simpler way while using this stand-alone function.

What to do next

--- this week done ・Cypress and ReactN can be combined for testing. Parallel translation and scaling with touchpad Group drawing (basic) Import from Regroup JSON doing When importing from JSON of Regroup, the position of stickies in a group is not correct. The function to display enlarged stickies was not yet available.


This page is auto-translated from /nishio/2021-07-01 using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.