Created attachment 123991 [details]
See the attached document, the draw shape and its textbox don't have the same position / size. It seems to be specific to a situation when a with-textbox and a without-textbox shape is anchored to the same paragraph.
Created attachment 123992 [details]
How it should look like
Created attachment 123993 [details]
How it looks like currently
Please see also bug #84691 with a similar problem.
Yes, I can see. It seems to be a different problem though (so not closing this one as a duplicate), as in this document the problem is caused by anchoring multiple shapes to the same paragraph, while there there is only a single shape.
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":
tdf#99004 SwAnchoredObjectPosition: handle textboxes when determining surround
It will be available in 5.2.0.
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.