Changeset View
Changeset View
Standalone View
Standalone View
plugins/flake/textshape/textlayout/KoTextShapeContainerModel.cpp
Show First 20 Lines • Show All 211 Lines • ▼ Show 20 Line(s) | 210 | if (layout->lineCount() > 0) { | |||
---|---|---|---|---|---|
212 | Q_ASSERT(data); | 212 | Q_ASSERT(data); | ||
213 | QTextLine tl = layout->lineForTextPosition(anchorPosInParag); | 213 | QTextLine tl = layout->lineForTextPosition(anchorPosInParag); | ||
214 | Q_ASSERT(tl.isValid()); | 214 | Q_ASSERT(tl.isValid()); | ||
215 | qreal y = tl.y() - data->documentOffset() - newPosition.y() + child->size().height(); | 215 | qreal y = tl.y() - data->documentOffset() - newPosition.y() + child->size().height(); | ||
216 | relation.anchor->setOffset(QPointF(relation.anchor->offset().x(), -y)); | 216 | relation.anchor->setOffset(QPointF(relation.anchor->offset().x(), -y)); | ||
217 | relayoutInlineObject(child); | 217 | relayoutInlineObject(child); | ||
218 | } | 218 | } | ||
219 | } else { | 219 | } else { | ||
220 | //TODO pavolk: handle position type change: absolute to realtive, etc .. | 220 | //TODO pavolk: handle position type change: absolute to relative, etc .. | ||
221 | child->setPosition(newPosition); | 221 | child->setPosition(newPosition); | ||
222 | relation.anchor->setOffset(relation.anchor->offset() + move); | 222 | relation.anchor->setOffset(relation.anchor->offset() + move); | ||
223 | relayoutInlineObject(child); | 223 | relayoutInlineObject(child); | ||
224 | } | 224 | } | ||
225 | 225 | | |||
226 | move.setX(0); // let the text layout move it. | 226 | move.setX(0); // let the text layout move it. | ||
227 | move.setY(0); | 227 | move.setY(0); | ||
228 | } | 228 | } | ||
Show All 11 Lines |