Changeset 63 for trunk/src/IDocument.cxx
- Timestamp:
- 04/14/06 14:36:57 (3 years ago)
- Files:
-
- 1 modified
-
trunk/src/IDocument.cxx (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/IDocument.cxx
r60 r63 654 654 655 655 /// 656 /// @brief Sets the current rotation degress. 657 /// 658 /// @param rotation The rotation in positive degrees. 659 /// If the parameter is greater than 360 degrees, its set 660 /// between 0 and 360 as a result of @a rotation % 360. 661 /// 662 void 663 IDocument::setRotation (gint rotation) 664 { 665 m_Rotation = (rotation % 360); 666 } 667 668 /// 656 669 /// @brief Rotates 90 to the left. 657 670 /// … … 661 674 IDocument::rotateLeft () 662 675 { 663 m_Rotation = (m_Rotation - 90) % 360; 664 if ( m_Rotation < 0 ) 665 { 666 m_Rotation += 360; 667 } 676 gint rotation = (getRotation () - 90); 677 if ( rotation < 0 ) 678 { 679 rotation += 360; 680 } 681 setRotation (rotation); 668 682 } 669 683 … … 676 690 IDocument::rotateRight () 677 691 { 678 m_Rotation = (m_Rotation + 90) % 360;692 setRotation (getRotation () + 90); 679 693 } 680 694 … … 706 720 /// @return The current zoom or scale level. 707 721 /// 708 g float722 gdouble 709 723 IDocument::getZoom (void) 710 724 { 711 725 return m_Scale; 726 } 727 728 /// 729 /// @brief Sets the current zoom. 730 /// 731 /// @param zoom The new zoom level. 732 /// 733 void 734 IDocument::setZoom (gdouble zoom) 735 { 736 m_Scale = zoom; 712 737 } 713 738 … … 725 750 if (canZoomIn ()) 726 751 { 727 m_Scale *= ZOOM_IN_FACTOR;752 setZoom (getZoom () * ZOOM_IN_FACTOR); 728 753 } 729 754 } … … 742 767 if (canZoomOut ()) 743 768 { 744 m_Scale *= ZOOM_OUT_FACTOR;769 setZoom (getZoom () * ZOOM_OUT_FACTOR); 745 770 } 746 771 } … … 766 791 gdouble widthScale = (gdouble)width / pageWidth; 767 792 gdouble heightScale = (gdouble)height / pageHeight; 768 m_Scale = MIN (widthScale, heightScale);793 setZoom (MIN (widthScale, heightScale)); 769 794 } 770 795 … … 784 809 785 810 getPageSize (&pageWidth, &pageHeight); 786 m_Scale = (gdouble)width / pageWidth;787 } 811 setZoom ((gdouble)width / pageWidth); 812 }
