<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/103876/">http://git.reviewboard.kde.org/r/103876/</a>
     </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This review has been submitted with commit b80bf64c501a8e272d94325838a7384ffe1b02e1 by Thibaut Gridel to branch master.</pre>
 <br />







<p>- Commit</p>


<br />
<p>On February 5th, 2012, 9:11 p.m., Thibaut Gridel wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Marble and Torsten Rahn.</div>
<div>By Thibaut Gridel.</div>


<p style="color: grey;"><i>Updated Feb. 5, 2012, 9:11 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Default linestrings and linerings have NoTessellation set.
A linestring which crosses the IDL is displayed while inserting fixed points on the IDL because of how current CrossesDateline in GeoData works.
This patch discards toDateLineCorrected for this case, and renders the screen straight line properly.

Also a performance boost not using toDateLineCorrected in the general case.

As a side note, the original bug could be alleviated while setting tesselation...</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Following code, inspired by original bug, with the 3 kinds of tesselation, works as expected.
compile with:
g++ -I /usr/include/qt4/ -I include/marble/ -o test test.cpp -Llib/ -lmarblewidget -lQtGui


#include <QtGui/QApplication>
#include <MarbleWidget.h>
#include <GeoPainter.h>
#include <GeoDataLinearRing.h>
#include <GeoDataCoordinates.h>

using namespace Marble;

class MyMarbleWidget : public MarbleWidget
{
public:
    virtual void customPaint(GeoPainter* painter);
};

void MyMarbleWidget::customPaint(GeoPainter* painter)
{
    const qreal lonWest  = -130;
    const qreal latNorth = 40;
    const qreal lonEast  = 160;
    const qreal latSouth = 30;

    Marble::GeoDataCoordinates coordTopLeft(lonWest, latNorth, 0, Marble::GeoDataCoordinates::Degree);
    Marble::GeoDataCoordinates coordTopRight(lonEast, latNorth + 20, 0, Marble::GeoDataCoordinates::Degree);
    Marble::GeoDataCoordinates coordBottomLeft(lonWest, latSouth, 0, Marble::GeoDataCoordinates::Degree);
    Marble::GeoDataCoordinates coordBottomRight(lonEast, latSouth, 0, Marble::GeoDataCoordinates::Degree);

    Marble::GeoDataLinearRing polyRingTesselated;
    polyRingTesselated.setTessellationFlags( Tessellate );
    polyRingTesselated << coordTopLeft << coordTopRight << coordBottomRight << coordBottomLeft;

    Marble::GeoDataLinearRing polyRingLatitude;
    polyRingLatitude.setTessellationFlags( Tessellate | RespectLatitudeCircle );
    polyRingLatitude << coordTopLeft << coordTopRight << coordBottomRight << coordBottomLeft;

    Marble::GeoDataLinearRing polyRingDefault;
    polyRingDefault << coordTopLeft << coordTopRight << coordBottomRight << coordBottomLeft;

    GeoDataLineString diag( Tessellate );
    diag << coordBottomLeft << coordTopRight;


    painter->setPen(Qt::blue);
    painter->drawPolygon(polyRingTesselated);
    painter->drawPolyline( diag );

    painter->setPen(Qt::green);
    painter->drawPolygon(polyRingLatitude);

    painter->setPen(Qt::red);
    painter->drawPolygon(polyRingDefault);
}

int main(int argc, char** argv)
{
    QApplication app(argc,argv);
    MyMarbleWidget *mapWidget = new MyMarbleWidget;
    mapWidget->setMapThemeId("earth/openstreetmap/openstreetmap.dgml");
    mapWidget->setProjection(Marble::Mercator);
    mapWidget->show();
    return app.exec();
}
</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=247360">247360</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/lib/Projections/AbstractProjection.cpp <span style="color: grey">(ed0488a)</span></li>

 <li>src/lib/geodata/data/GeoDataLineString.cpp <span style="color: grey">(2900374)</span></li>

 <li>src/lib/geodata/data/GeoDataLinearRing.cpp <span style="color: grey">(d3d51df)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/103876/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>