Changeset View
Changeset View
Standalone View
Standalone View
words/part/KWViewModeNormal.cpp
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 82 | for(; page.isValid(); page = page.next()) { | |||
---|---|---|---|---|---|
96 | const QRectF zoomedPage = viewConverter->documentToView(pageRect); | 96 | const QRectF zoomedPage = viewConverter->documentToView(pageRect); | ||
97 | ViewMap vm; | 97 | ViewMap vm; | ||
98 | vm.page = page; | 98 | vm.page = page; | ||
99 | //kDebug(32003) <<"page" << page.pageNumber(); | 99 | //kDebug(32003) <<"page" << page.pageNumber(); | ||
100 | vm.distance = viewConverter->documentToView(QPointF(offsetX, offsetY)); | 100 | vm.distance = viewConverter->documentToView(QPointF(offsetX, offsetY)); | ||
101 | 101 | | |||
102 | const QRectF targetPage(zoomedPage.x() + vm.distance.x(), zoomedPage.y() + vm.distance.y(), | 102 | const QRectF targetPage(zoomedPage.x() + vm.distance.x(), zoomedPage.y() + vm.distance.y(), | ||
103 | zoomedPage.width(), zoomedPage.height()); | 103 | zoomedPage.width(), zoomedPage.height()); | ||
104 | QRectF intersection = targetPage.intersect(viewRect); | 104 | QRectF intersection = targetPage.intersected(viewRect); | ||
105 | if (! intersection.isEmpty()) { | 105 | if (! intersection.isEmpty()) { | ||
106 | intersection.moveTopLeft(intersection.topLeft() - vm.distance); | 106 | intersection.moveTopLeft(intersection.topLeft() - vm.distance); | ||
107 | vm.clipRect = intersection.toRect(); | 107 | vm.clipRect = intersection.toRect(); | ||
108 | answer.append(vm); | 108 | answer.append(vm); | ||
109 | pageIntersects = true; | 109 | pageIntersects = true; | ||
110 | } | 110 | } | ||
111 | 111 | | |||
112 | // 2. Then handle the annotation area if annotations are active. | 112 | // 2. Then handle the annotation area if annotations are active. | ||
Show All 13 Lines | 123 | if (1 /* annotations are shown */) { | |||
126 | const QRectF zoomedAnnotation = viewConverter->documentToView(annotationRect); | 126 | const QRectF zoomedAnnotation = viewConverter->documentToView(annotationRect); | ||
127 | ViewMap vm2; | 127 | ViewMap vm2; | ||
128 | vm2.page = page; | 128 | vm2.page = page; | ||
129 | vm2.distance = viewConverter->documentToView(QPointF(offsetX, offsetY)); | 129 | vm2.distance = viewConverter->documentToView(QPointF(offsetX, offsetY)); | ||
130 | 130 | | |||
131 | const QRectF targetAnnotation(zoomedAnnotation.x() + vm2.distance.x(), | 131 | const QRectF targetAnnotation(zoomedAnnotation.x() + vm2.distance.x(), | ||
132 | zoomedAnnotation.y() + vm2.distance.y(), | 132 | zoomedAnnotation.y() + vm2.distance.y(), | ||
133 | zoomedAnnotation.width(), zoomedAnnotation.height()); | 133 | zoomedAnnotation.width(), zoomedAnnotation.height()); | ||
134 | intersection = targetAnnotation.intersect(viewRect); | 134 | intersection = targetAnnotation.intersected(viewRect); | ||
135 | if (! intersection.isEmpty()) { | 135 | if (! intersection.isEmpty()) { | ||
136 | intersection.moveTopLeft(intersection.topLeft() - vm2.distance); | 136 | intersection.moveTopLeft(intersection.topLeft() - vm2.distance); | ||
137 | vm2.clipRect = intersection.toRect(); | 137 | vm2.clipRect = intersection.toRect(); | ||
138 | answer.append(vm2); | 138 | answer.append(vm2); | ||
139 | pageIntersects = true; | 139 | pageIntersects = true; | ||
140 | } | 140 | } | ||
141 | } | 141 | } | ||
142 | 142 | | |||
Show All 23 Lines | 164 | for(; page.isValid(); page = page.next()) { | |||
166 | const QRectF zoomedPage = viewConverter->documentToView(pageRect); | 166 | const QRectF zoomedPage = viewConverter->documentToView(pageRect); | ||
167 | ViewMap vm; | 167 | ViewMap vm; | ||
168 | vm.page = page; | 168 | vm.page = page; | ||
169 | 169 | | |||
170 | const qreal offsetY = m_pageTops[page.pageNumber() - pageOffset] - pageRect.top(); | 170 | const qreal offsetY = m_pageTops[page.pageNumber() - pageOffset] - pageRect.top(); | ||
171 | vm.distance = viewConverter->documentToView(QPointF(offsetX, offsetY)); | 171 | vm.distance = viewConverter->documentToView(QPointF(offsetX, offsetY)); | ||
172 | #if 0 | 172 | #if 0 | ||
173 | const QRectF targetPage(zoomedPage.x() + vm.distance.x(), zoomedPage.y() + vm.distance.y(), zoomedPage.width() , zoomedPage.height()); | 173 | const QRectF targetPage(zoomedPage.x() + vm.distance.x(), zoomedPage.y() + vm.distance.y(), zoomedPage.width() , zoomedPage.height()); | ||
174 | QRectF intersection = targetPage.intersect(viewRect); | 174 | QRectF intersection = targetPage.intersected(viewRect); | ||
175 | if (! intersection.isEmpty()) { | 175 | if (! intersection.isEmpty()) { | ||
176 | intersection.moveTopLeft(intersection.topLeft() - vm.distance); | 176 | intersection.moveTopLeft(intersection.topLeft() - vm.distance); | ||
177 | vm.clipRect = intersection.toRect(); | 177 | vm.clipRect = intersection.toRect(); | ||
178 | answer.append(vm); | 178 | answer.append(vm); | ||
179 | } | 179 | } | ||
180 | #else | 180 | #else | ||
181 | const QRectF targetPage(zoomedPage.x() + vm.distance.x(), zoomedPage.y() + vm.distance.y(), zoomedPage.width() , zoomedPage.height()); | 181 | const QRectF targetPage(zoomedPage.x() + vm.distance.x(), zoomedPage.y() + vm.distance.y(), zoomedPage.width() , zoomedPage.height()); | ||
182 | vm.clipRect = targetPage.toRect(); | 182 | vm.clipRect = targetPage.toRect(); | ||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |