<commit_before>//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2009      <NAME>  <<EMAIL>>
// Copyright 2013      <NAME> <<EMAIL>>
// Copyright 2014      <NAME>  <<EMAIL>>
//

// Self
#include "PlacemarkTextAnnotation.h"

// Qt
#include <QImage>

// Marble
#include "AbstractProjection.h"
#include "GeoDataPlacemark.h"
#include "GeoDataStyle.h"
#include "GeoPainter.h"
#include "ViewportParams.h"
#include "MarbleDirs.h"
#include "SceneGraphicsTypes.h"


namespace Marble
{

PlacemarkTextAnnotation::PlacemarkTextAnnotation( GeoDataPlacemark *placemark ) :
    SceneGraphicsItem( placemark ),
    m_movingPlacemark( false )
{
    GeoDataStyle *newStyle = new GeoDataStyle( *placemark->style() );
    newStyle->iconStyle().setIcon( QImage() );
    newStyle->iconStyle().setIconPath( MarbleDirs::path( "bitmaps/default_location.png" ) );
    placemark->setStyle( newStyle );
}

PlacemarkTextAnnotation::~PlacemarkTextAnnotation()
{
    // nothing to do
}

void PlacemarkTextAnnotation::paint( GeoPainter *painter, const ViewportParams *viewport )
{
    Q_UNUSED( painter );
    m_viewport = viewport;
    painter->drawImage( placemark()->coordinate(), QImage( placemark()->style()->iconStyle().iconPath() ) );

    qreal x, y;
    viewport->currentProjection()->screenCoordinates( placemark()->coordinate(), viewport, x, y );
    m_region = QRegion( x - 10 , y - 10 , 20 , 20 );<commit_msg>Solved bug which caused the placemark icon to not be copied<commit_after>//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2009      <NAME>  <<EMAIL>>
// Copyright 2013      <NAME> <<EMAIL>>
// Copyright 2014      <NAME>  <<EMAIL>>
//

// Self
#include "PlacemarkTextAnnotation.h"

// Qt
#include <QImage>

// Marble
#include "AbstractProjection.h"
#include "GeoDataPlacemark.h"
#include "GeoDataStyle.h"
#include "GeoPainter.h"
#include "ViewportParams.h"
#include "MarbleDirs.h"
#include "SceneGraphicsTypes.h"


namespace Marble
{

PlacemarkTextAnnotation::PlacemarkTextAnnotation( GeoDataPlacemark *placemark ) :
    SceneGraphicsItem( placemark ),
    m_movingPlacemark( false )
{
    if ( placemark->style()->iconStyle().iconPath().isNull() ) {
        GeoDataStyle *newStyle = new GeoDataStyle( *placemark->style() );
        newStyle->iconStyle().setIcon( QImage() );
        newStyle->iconStyle().setIconPath( MarbleDirs::path( "bitmaps/default_location.png" ) );
        placemark->setStyle( newStyle );
    }
}

PlacemarkTextAnnotation::~PlacemarkTextAnnotation()
{
    // nothing to do
}

void PlacemarkTextAnnotation::paint( GeoPainter *painter, const ViewportParams *viewport )
{
    Q_UNUSED( painter );
    m_viewport = viewport;
    painter->drawImage( placemark()->coordinate(), QImage( placemark()->style()->iconStyle().iconPath() ) );

    qreal x, y;
    viewport->currentProjection()->screenCoordinates( placemark()->coordinate(), viewport, x, y );
    m_region = QRegion( x - 10 , y - 10 , 20 , 20 );
{'fraction_non_alphanumeric': 0.14037229173024107, 'fraction_numerical': 0.012206286237412267, 'mean_word_length': 3.974203338391502, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1787791', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1075, 'n_words': 266}