Changeset View
Changeset View
Standalone View
Standalone View
ui/pagepainter.cpp
Show First 20 Lines • Show All 472 Lines • ▼ Show 20 Line(s) | 450 | { | |||
---|---|---|---|---|---|
473 | // draw the line as normalized path into image | 473 | // draw the line as normalized path into image | ||
474 | drawShapeOnImage( backImage, path, la->lineClosed(), | 474 | drawShapeOnImage( backImage, path, la->lineClosed(), | ||
475 | linePen, | 475 | linePen, | ||
476 | fillBrush, pageScale ,Multiply); | 476 | fillBrush, pageScale ,Multiply); | ||
477 | 477 | | |||
478 | if ( path.count() == 2 && fabs( la->lineLeadingForwardPoint() ) > 0.1 ) | 478 | if ( path.count() == 2 && fabs( la->lineLeadingForwardPoint() ) > 0.1 ) | ||
479 | { | 479 | { | ||
480 | Okular::NormalizedPoint delta( la->transformedLinePoints().last().x - la->transformedLinePoints().first().x, la->transformedLinePoints().first().y - la->transformedLinePoints().last().y ); | 480 | Okular::NormalizedPoint delta( la->transformedLinePoints().last().x - la->transformedLinePoints().first().x, la->transformedLinePoints().first().y - la->transformedLinePoints().last().y ); | ||
481 | double angle = atan2( delta.y, delta.x ); | 481 | double angle = atan2( delta.y * page->height(), delta.x * page->width() ); | ||
482 | if ( delta.y < 0 ) | 482 | if ( delta.y < 0 ) | ||
483 | angle += 2 * M_PI; | 483 | angle += 2 * M_PI; | ||
484 | 484 | | |||
485 | int sign = la->lineLeadingForwardPoint() > 0.0 ? 1 : -1; | 485 | int sign = la->lineLeadingForwardPoint() > 0.0 ? 1 : -1; | ||
486 | double LLx = fabs( la->lineLeadingForwardPoint() ) * cos( angle + sign * M_PI_2 + 2 * M_PI ) / page->width(); | 486 | double LLx = fabs( la->lineLeadingForwardPoint() ) * cos( angle + sign * M_PI_2 + 2 * M_PI ) / page->width(); | ||
487 | double LLy = fabs( la->lineLeadingForwardPoint() ) * sin( angle + sign * M_PI_2 + 2 * M_PI ) / page->height(); | 487 | double LLy = fabs( la->lineLeadingForwardPoint() ) * sin( angle + sign * M_PI_2 + 2 * M_PI ) / page->height(); | ||
488 | 488 | | |||
489 | NormalizedPath path2; | 489 | NormalizedPath path2; | ||
▲ Show 20 Lines • Show All 515 Lines • Show Last 20 Lines |