[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kviewshell-0.7/kviewshell/shell
From:       Wilfried Huss <Wilfried.Huss () gmx ! at>
Date:       2006-10-18 19:44:29
Message-ID: 1161200669.615795.2992.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 596871 by whuss:

Make searching work better for rotated viewmodes.

 M  +19 -1     pageView.cpp  


--- branches/work/kviewshell-0.7/kviewshell/shell/pageView.cpp #596870:596871
@@ -1020,8 +1020,26 @@
       }
   }
 
-  unsigned int y = pageData->textBoxList[selection.getSelectedTextStart()].box.top();
+  QRect box = pageData->textBoxList[selection.getSelectedTextStart()].box;
 
+  unsigned int y = 0;
+
+  switch (dataModel->preferences()->rotation())
+  {
+    case KVSPrefs::EnumRotation::Landscape:
+      y = box.left();
+      break;
+    case KVSPrefs::EnumRotation::Upsidedown:
+      y = pageCache->sizeOfPageInPixel(selection.getPageNumber()).height() - box.bottom();
+      break;
+    case KVSPrefs::EnumRotation::Seascape:
+      y = pageCache->sizeOfPageInPixel(selection.getPageNumber()).width() - box.right();
+      break;
+    case KVSPrefs::EnumRotation::Portrait:
+    default:
+      y = box.top();
+  }
+
   Length l;
   l.setLength_in_pixel(y, dataModel->resolution());
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic