textlineprimitive2d.cxx (464702f4) | textlineprimitive2d.cxx (e38dead8) |
---|---|
1/************************************************************** | 1/************************************************************** |
2 * | 2 * |
3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at | 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at |
10 * | 10 * |
11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
12 * | 12 * |
13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. | 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. |
19 * | 19 * |
20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_drawinglayer.hxx" 26 27#include <drawinglayer/primitive2d/textlineprimitive2d.hxx> --- 164 unchanged lines hidden (view full) --- 192 } 193 194 // create base polygon and new primitive 195 basegfx::B2DPolygon aLine; 196 Primitive2DReference aNewPrimitive; 197 198 aLine.append(basegfx::B2DPoint(0.0, fOffset)); 199 aLine.append(basegfx::B2DPoint(getWidth(), fOffset)); | 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_drawinglayer.hxx" 26 27#include <drawinglayer/primitive2d/textlineprimitive2d.hxx> --- 164 unchanged lines hidden (view full) --- 192 } 193 194 // create base polygon and new primitive 195 basegfx::B2DPolygon aLine; 196 Primitive2DReference aNewPrimitive; 197 198 aLine.append(basegfx::B2DPoint(0.0, fOffset)); 199 aLine.append(basegfx::B2DPoint(getWidth(), fOffset)); |
200 | 200 |
201 const basegfx::B2DHomMatrix aUnscaledTransform( 202 basegfx::tools::createShearXRotateTranslateB2DHomMatrix( 203 fShearX, fRotate, aTranslate)); | 201 const basegfx::B2DHomMatrix aUnscaledTransform( 202 basegfx::tools::createShearXRotateTranslateB2DHomMatrix( 203 fShearX, fRotate, aTranslate)); |
204 | 204 |
205 aLine.transform(aUnscaledTransform); 206 207 if(bWaveLine) 208 { 209 double fWaveWidth(10.6 * fHeight); 210 211 if(TEXT_LINE_SMALLWAVE == getTextLine()) 212 { --- 15 unchanged lines hidden (view full) --- 228 // add primitive 229 appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, aNewPrimitive); 230 231 if(bDoubleLine) 232 { 233 // double line, create 2nd primitive with offset using TransformPrimitive based on 234 // already created NewPrimitive 235 double fLineDist(2.3 * fHeight); | 205 aLine.transform(aUnscaledTransform); 206 207 if(bWaveLine) 208 { 209 double fWaveWidth(10.6 * fHeight); 210 211 if(TEXT_LINE_SMALLWAVE == getTextLine()) 212 { --- 15 unchanged lines hidden (view full) --- 228 // add primitive 229 appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, aNewPrimitive); 230 231 if(bDoubleLine) 232 { 233 // double line, create 2nd primitive with offset using TransformPrimitive based on 234 // already created NewPrimitive 235 double fLineDist(2.3 * fHeight); |
236 | 236 |
237 if(bWaveLine) 238 { 239 fLineDist = 6.3 * fHeight; 240 } 241 242 // move base point of text to 0.0 and de-rotate 243 basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix( 244 -aTranslate.getX(), -aTranslate.getY())); 245 aTransform.rotate(-fRotate); 246 247 // translate in Y by offset 248 aTransform.translate(0.0, fLineDist); 249 250 // move back and rotate 251 aTransform.rotate(fRotate); 252 aTransform.translate(aTranslate.getX(), aTranslate.getY()); 253 254 // add transform primitive 255 const Primitive2DSequence aContent(&aNewPrimitive, 1); | 237 if(bWaveLine) 238 { 239 fLineDist = 6.3 * fHeight; 240 } 241 242 // move base point of text to 0.0 and de-rotate 243 basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix( 244 -aTranslate.getX(), -aTranslate.getY())); 245 aTransform.rotate(-fRotate); 246 247 // translate in Y by offset 248 aTransform.translate(0.0, fLineDist); 249 250 // move back and rotate 251 aTransform.rotate(fRotate); 252 aTransform.translate(aTranslate.getX(), aTranslate.getY()); 253 254 // add transform primitive 255 const Primitive2DSequence aContent(&aNewPrimitive, 1); |
256 appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, | 256 appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, |
257 Primitive2DReference(new TransformPrimitive2D(aTransform, aContent))); 258 } 259 } 260 261 return xRetval; 262 } 263 264 TextLinePrimitive2D::TextLinePrimitive2D( --- 31 unchanged lines hidden (view full) --- 296 } 297 298 // provide unique ID 299 ImplPrimitrive2DIDBlock(TextLinePrimitive2D, PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D) 300 301 } // end of namespace primitive2d 302} // end of namespace drawinglayer 303 | 257 Primitive2DReference(new TransformPrimitive2D(aTransform, aContent))); 258 } 259 } 260 261 return xRetval; 262 } 263 264 TextLinePrimitive2D::TextLinePrimitive2D( --- 31 unchanged lines hidden (view full) --- 296 } 297 298 // provide unique ID 299 ImplPrimitrive2DIDBlock(TextLinePrimitive2D, PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D) 300 301 } // end of namespace primitive2d 302} // end of namespace drawinglayer 303 |
304////////////////////////////////////////////////////////////////////////////// 305// eof | 304/* vim: set noet sw=4 ts=4: */ |