1053 |
1053 |
1054 // check the panning in four directions now. |
1054 // check the panning in four directions now. |
1055 TInt aX,aY; |
1055 TInt aX,aY; |
1056 // Check in Left direction |
1056 // Check in Left direction |
1057 aX = 1; aY = 0; |
1057 aX = 1; aY = 0; |
1058 if ( xmax <= clipWidth && aX < 0 ) |
1058 //Coverity fixes |
|
1059 if ( bound.iX >= zero ) |
1059 aX = 0; |
1060 aX = 0; |
1060 if ( bound.iX >= zero && aX > 0 ) |
1061 |
1061 aX = 0; |
|
1062 if ( ymax <= clipHeight && aY < 0 ) |
|
1063 aY = 0; |
|
1064 if ( bound.iY >= zero && aY > 0 ) |
|
1065 aY = 0; |
|
1066 // Do panning |
1062 // Do panning |
1067 if ( ( aY == 0 ) && ( aX == 0 ) ) |
1063 left = ((aY)||(aX)); |
1068 left = EFalse; |
|
1069 else |
|
1070 left = ETrue; |
|
1071 |
1064 |
1072 // Check in Right direction |
1065 // Check in Right direction |
1073 aX = -1; aY = 0; |
1066 aX = -1; aY = 0; |
1074 if ( xmax <= clipWidth && aX < 0 ) |
1067 if ( xmax <= clipWidth ) |
1075 aX = 0; |
1068 aX = 0; |
1076 if ( bound.iX >= zero && aX > 0 ) |
1069 |
1077 aX = 0; |
|
1078 if ( ymax <= clipHeight && aY < 0 ) |
|
1079 aY = 0; |
|
1080 if ( bound.iY >= zero && aY > 0 ) |
|
1081 aY = 0; |
|
1082 // Do panning |
1070 // Do panning |
1083 if ( ( aY == 0 ) && ( aX == 0 ) ) |
1071 right = ((aY)||(aX)); |
1084 right = EFalse; |
|
1085 else |
|
1086 right = ETrue; |
|
1087 |
1072 |
1088 // Check in Up direction |
1073 // Check in Up direction |
1089 aX = 0; aY = 1; |
1074 aX = 0; aY = 1; |
1090 if ( xmax <= clipWidth && aX < 0 ) |
1075 if ( bound.iY >= zero ) |
1091 aX = 0; |
|
1092 if ( bound.iX >= zero && aX > 0 ) |
|
1093 aX = 0; |
|
1094 if ( ymax <= clipHeight && aY < 0 ) |
|
1095 aY = 0; |
1076 aY = 0; |
1096 if ( bound.iY >= zero && aY > 0 ) |
1077 |
1097 aY = 0; |
|
1098 // Do panning |
1078 // Do panning |
1099 if ( ( aY == 0 ) && ( aX == 0 ) ) |
1079 up = ((aY)||(aX)); |
1100 up = EFalse; |
|
1101 else |
|
1102 up = ETrue; |
|
1103 |
1080 |
1104 // Check in down direction |
1081 // Check in down direction |
1105 aX = 0; aY = -1; |
1082 aX = 0; aY = -1; |
1106 if ( xmax <= clipWidth && aX < 0 ) |
1083 if ( ymax <= clipHeight ) |
1107 aX = 0; |
|
1108 if ( bound.iX >= zero && aX > 0 ) |
|
1109 aX = 0; |
|
1110 if ( ymax <= clipHeight && aY < 0 ) |
|
1111 aY = 0; |
1084 aY = 0; |
1112 if ( bound.iY >= zero && aY > 0 ) |
1085 |
1113 aY = 0; |
|
1114 // Do panning |
1086 // Do panning |
1115 if ( ( aY == 0 ) && ( aX == 0 ) ) |
1087 down = ((aY)||(aX)); |
1116 down = EFalse; |
|
1117 else |
|
1118 down = ETrue; |
|
1119 |
1088 |
1120 } |
1089 } |
1121 // -------------------------------------------------------------------------- |
1090 // -------------------------------------------------------------------------- |
1122 // EXPORT_C void CSvgEngineInterfaceImpl::Rotate( TReal32 aAngle, |
1091 // EXPORT_C void CSvgEngineInterfaceImpl::Rotate( TReal32 aAngle, |
1123 // --------------------------------------------------------------------------- |
1092 // --------------------------------------------------------------------------- |
1217 TSize bbSize = GetSvgBoundingBox().Size(); |
1186 TSize bbSize = GetSvgBoundingBox().Size(); |
1218 if( svgElement->iWidthInPercentage ) |
1187 if( svgElement->iWidthInPercentage ) |
1219 { |
1188 { |
1220 bbSize.iWidth = ((TReal32)bbSize.iWidth) * percentWidth / 100.0; |
1189 bbSize.iWidth = ((TReal32)bbSize.iWidth) * percentWidth / 100.0; |
1221 } |
1190 } |
1222 else |
|
1223 { |
|
1224 bbSize.iWidth = bbSize.iWidth; |
|
1225 } |
|
1226 |
1191 |
1227 if( svgElement->iHeightInPercentage ) |
1192 if( svgElement->iHeightInPercentage ) |
1228 { |
1193 { |
1229 bbSize.iHeight = ((TReal32)bbSize.iHeight) * percentHeight / 100.0; |
1194 bbSize.iHeight = ((TReal32)bbSize.iHeight) * percentHeight / 100.0; |
1230 } |
|
1231 else |
|
1232 { |
|
1233 bbSize.iHeight = bbSize.iHeight; |
|
1234 } |
1195 } |
1235 return bbSize; |
1196 return bbSize; |
1236 } |
1197 } |
1237 } |
1198 } |
1238 |
1199 |
3100 EXPORT_C void CSvgEngineInterfaceImpl::GetFourPointElementBoundingBox(CSvgTextElementImpl* aTextElementHandle, TPoint& aPoint1, TPoint& aPoint2, TPoint& aPoint3, TPoint& aPoint4) |
3061 EXPORT_C void CSvgEngineInterfaceImpl::GetFourPointElementBoundingBox(CSvgTextElementImpl* aTextElementHandle, TPoint& aPoint1, TPoint& aPoint2, TPoint& aPoint3, TPoint& aPoint4) |
3101 { |
3062 { |
3102 TSvgFourPointRect fourPointRect; |
3063 TSvgFourPointRect fourPointRect; |
3103 |
3064 |
3104 //updates CTM from root |
3065 //updates CTM from root |
3105 aTextElementHandle->UpdateCTM(); |
|
3106 |
|
3107 if (aTextElementHandle) |
3066 if (aTextElementHandle) |
3108 { |
3067 { |
|
3068 aTextElementHandle->UpdateCTM(); |
3109 aTextElementHandle->GetFourPointBBox(fourPointRect); |
3069 aTextElementHandle->GetFourPointBBox(fourPointRect); |
3110 } |
3070 } |
3111 |
3071 |
3112 fourPointRect.GetPoints(aPoint1, aPoint2, aPoint3, aPoint4); |
3072 fourPointRect.GetPoints(aPoint1, aPoint2, aPoint3, aPoint4); |
3113 } |
3073 } |