Commit cfc2b625 authored by Thomas Zander's avatar Thomas Zander

Fixes: slowness on embedded devices.

Details: On embedded devices like n810 (which uses an Arm processor) usage
of double is incredably expensive.  In almost all cases our usage of double
can be done just as well using floats on those devices.
This is something that Qt does as well using the type 'qreal' which is a
double on all modern platforms but float on those that don't have double
natively.  So we get the best of both worlds by replacing double with qreal.

svn path=/trunk/koffice/; revision=851499
parent 42f7fbda
...@@ -50,7 +50,7 @@ void KisGrayU16ColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, Q ...@@ -50,7 +50,7 @@ void KisGrayU16ColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, Q
{ {
const GrayU16Traits::channels_type* p = reinterpret_cast<const GrayU16Traits::channels_type*>( pixel ); const GrayU16Traits::channels_type* p = reinterpret_cast<const GrayU16Traits::channels_type*>( pixel );
QDomElement labElt = doc.createElement( "Gray" ); QDomElement labElt = doc.createElement( "Gray" );
labElt.setAttribute("g", KoColorSpaceMaths< GrayU16Traits::channels_type, double>::scaleToA( p[0]) ); labElt.setAttribute("g", KoColorSpaceMaths< GrayU16Traits::channels_type, qreal>::scaleToA( p[0]) );
labElt.setAttribute("space", profile()->name() ); labElt.setAttribute("space", profile()->name() );
colorElt.appendChild( labElt ); colorElt.appendChild( labElt );
} }
...@@ -58,6 +58,6 @@ void KisGrayU16ColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, Q ...@@ -58,6 +58,6 @@ void KisGrayU16ColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, Q
void KisGrayU16ColorSpace::colorFromXML( quint8* pixel, const QDomElement& elt) const void KisGrayU16ColorSpace::colorFromXML( quint8* pixel, const QDomElement& elt) const
{ {
GrayU16Traits::channels_type* p = reinterpret_cast<GrayU16Traits::channels_type*>( pixel ); GrayU16Traits::channels_type* p = reinterpret_cast<GrayU16Traits::channels_type*>( pixel );
p[0] = KoColorSpaceMaths< double, GrayU16Traits::channels_type >::scaleToA(elt.attribute("g").toDouble()); p[0] = KoColorSpaceMaths< qreal, GrayU16Traits::channels_type >::scaleToA(elt.attribute("g").toDouble());
} }
...@@ -51,7 +51,7 @@ void KisGrayColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, QDom ...@@ -51,7 +51,7 @@ void KisGrayColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, QDom
{ {
const GrayU8Traits::channels_type* p = reinterpret_cast<const GrayU8Traits::channels_type*>( pixel ); const GrayU8Traits::channels_type* p = reinterpret_cast<const GrayU8Traits::channels_type*>( pixel );
QDomElement labElt = doc.createElement( "Gray" ); QDomElement labElt = doc.createElement( "Gray" );
labElt.setAttribute("g", KoColorSpaceMaths< GrayU8Traits::channels_type, double>::scaleToA( p[0]) ); labElt.setAttribute("g", KoColorSpaceMaths< GrayU8Traits::channels_type, qreal>::scaleToA( p[0]) );
labElt.setAttribute("space", profile()->name() ); labElt.setAttribute("space", profile()->name() );
colorElt.appendChild( labElt ); colorElt.appendChild( labElt );
} }
...@@ -59,6 +59,6 @@ void KisGrayColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, QDom ...@@ -59,6 +59,6 @@ void KisGrayColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, QDom
void KisGrayColorSpace::colorFromXML( quint8* pixel, const QDomElement& elt) const void KisGrayColorSpace::colorFromXML( quint8* pixel, const QDomElement& elt) const
{ {
GrayU8Traits::channels_type* p = reinterpret_cast<GrayU8Traits::channels_type*>( pixel ); GrayU8Traits::channels_type* p = reinterpret_cast<GrayU8Traits::channels_type*>( pixel );
p[0] = KoColorSpaceMaths< double, GrayU8Traits::channels_type >::scaleToA(elt.attribute("g").toDouble()); p[0] = KoColorSpaceMaths< qreal, GrayU8Traits::channels_type >::scaleToA(elt.attribute("g").toDouble());
} }
...@@ -62,9 +62,9 @@ void KisXyzU16ColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, QD ...@@ -62,9 +62,9 @@ void KisXyzU16ColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, QD
{ {
const XyzU16Traits::Pixel* p = reinterpret_cast<const XyzU16Traits::Pixel*>( pixel ); const XyzU16Traits::Pixel* p = reinterpret_cast<const XyzU16Traits::Pixel*>( pixel );
QDomElement labElt = doc.createElement( "XYZ" ); QDomElement labElt = doc.createElement( "XYZ" );
labElt.setAttribute("x", KoColorSpaceMaths< XyzU16Traits::channels_type, double>::scaleToA( p->X) ); labElt.setAttribute("x", KoColorSpaceMaths< XyzU16Traits::channels_type, qreal>::scaleToA( p->X) );
labElt.setAttribute("y", KoColorSpaceMaths< XyzU16Traits::channels_type, double>::scaleToA( p->Y) ); labElt.setAttribute("y", KoColorSpaceMaths< XyzU16Traits::channels_type, qreal>::scaleToA( p->Y) );
labElt.setAttribute("z", KoColorSpaceMaths< XyzU16Traits::channels_type, double>::scaleToA( p->Z) ); labElt.setAttribute("z", KoColorSpaceMaths< XyzU16Traits::channels_type, qreal>::scaleToA( p->Z) );
labElt.setAttribute("space", profile()->name() ); labElt.setAttribute("space", profile()->name() );
colorElt.appendChild( labElt ); colorElt.appendChild( labElt );
} }
...@@ -72,8 +72,8 @@ void KisXyzU16ColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, QD ...@@ -72,8 +72,8 @@ void KisXyzU16ColorSpace::colorToXML( const quint8* pixel, QDomDocument& doc, QD
void KisXyzU16ColorSpace::colorFromXML( quint8* pixel, const QDomElement& elt) const void KisXyzU16ColorSpace::colorFromXML( quint8* pixel, const QDomElement& elt) const
{ {
XyzU16Traits::Pixel* p = reinterpret_cast<XyzU16Traits::Pixel*>( pixel ); XyzU16Traits::Pixel* p = reinterpret_cast<XyzU16Traits::Pixel*>( pixel );
p->X = KoColorSpaceMaths< double, XyzU16Traits::channels_type >::scaleToA(elt.attribute("x").toDouble()); p->X = KoColorSpaceMaths< qreal, XyzU16Traits::channels_type >::scaleToA(elt.attribute("x").toDouble());
p->Y = KoColorSpaceMaths< double, XyzU16Traits::channels_type >::scaleToA(elt.attribute("y").toDouble()); p->Y = KoColorSpaceMaths< qreal, XyzU16Traits::channels_type >::scaleToA(elt.attribute("y").toDouble());
p->Z = KoColorSpaceMaths< double, XyzU16Traits::channels_type >::scaleToA(elt.attribute("z").toDouble()); p->Z = KoColorSpaceMaths< qreal, XyzU16Traits::channels_type >::scaleToA(elt.attribute("z").toDouble());
} }
...@@ -154,7 +154,7 @@ KisLayerBox::KisLayerBox() ...@@ -154,7 +154,7 @@ KisLayerBox::KisLayerBox()
connect(m_wdgLayerBox->bnProperties, SIGNAL(clicked()), SLOT(slotPropertiesClicked())); connect(m_wdgLayerBox->bnProperties, SIGNAL(clicked()), SLOT(slotPropertiesClicked()));
connect(m_wdgLayerBox->bnDuplicate, SIGNAL(clicked()), SLOT(slotDuplicateClicked())); connect(m_wdgLayerBox->bnDuplicate, SIGNAL(clicked()), SLOT(slotDuplicateClicked()));
connect(m_wdgLayerBox->doubleOpacity, SIGNAL(valueChanged(double, bool)), SIGNAL(sigOpacityChanged(double, bool))); connect(m_wdgLayerBox->doubleOpacity, SIGNAL(valueChanged(qreal, bool)), SIGNAL(sigOpacityChanged(qreal, bool)));
connect(m_wdgLayerBox->cmbComposite, SIGNAL(activated(const KoCompositeOp*)), SIGNAL(sigItemComposite(const KoCompositeOp*))); connect(m_wdgLayerBox->cmbComposite, SIGNAL(activated(const KoCompositeOp*)), SIGNAL(sigItemComposite(const KoCompositeOp*)));
} }
......
...@@ -78,7 +78,7 @@ signals: ...@@ -78,7 +78,7 @@ signals:
// use strings // use strings
void sigRequestNewNode( const QString & nodetype); void sigRequestNewNode( const QString & nodetype);
void sigRequestNodeProperties(KisNodeSP node); void sigRequestNodeProperties(KisNodeSP node);
void sigOpacityChanged(double opacity, bool final); void sigOpacityChanged(qreal opacity, bool final);
void sigItemComposite(const KoCompositeOp*); void sigItemComposite(const KoCompositeOp*);
private slots: private slots:
......
...@@ -337,7 +337,7 @@ void KisNodeManager::nodeProperties( KisNodeSP node ) ...@@ -337,7 +337,7 @@ void KisNodeManager::nodeProperties( KisNodeSP node )
} }
} }
void KisNodeManager::nodeOpacityChanged( double opacity, bool final) void KisNodeManager::nodeOpacityChanged( qreal opacity, bool final)
{ {
m_d->layerManager->layerOpacity( opacity, final ); m_d->layerManager->layerOpacity( opacity, final );
} }
......
...@@ -88,7 +88,7 @@ public slots: ...@@ -88,7 +88,7 @@ public slots:
void activateNode( KisNodeSP layer ); void activateNode( KisNodeSP layer );
void nodesUpdated(); void nodesUpdated();
void nodeProperties( KisNodeSP node ); void nodeProperties( KisNodeSP node );
void nodeOpacityChanged( double opacity, bool final); void nodeOpacityChanged( qreal opacity, bool final);
void nodeCompositeOpChanged( const KoCompositeOp* op ); void nodeCompositeOpChanged( const KoCompositeOp* op );
void duplicateActiveNode( KisNodeSP node ); void duplicateActiveNode( KisNodeSP node );
......
...@@ -125,7 +125,7 @@ QWidget * KisToolPaint::createOptionWidget() ...@@ -125,7 +125,7 @@ QWidget * KisToolPaint::createOptionWidget()
m_slOpacity->setMaximum(100); m_slOpacity->setMaximum(100);
m_slOpacity->setDecimals(0); m_slOpacity->setDecimals(0);
m_slOpacity->setValue(m_opacity / OPACITY_OPAQUE * 100); m_slOpacity->setValue(m_opacity / OPACITY_OPAQUE * 100);
connect(m_slOpacity, SIGNAL(valueChanged(double, bool)), this, SLOT(slotSetOpacity(double, bool))); connect(m_slOpacity, SIGNAL(valueChanged(qreal, bool)), this, SLOT(slotSetOpacity(qreal, bool)));
m_lbComposite = new QLabel(i18n("Mode: "), optionWidget); m_lbComposite = new QLabel(i18n("Mode: "), optionWidget);
m_cmbComposite = new KisCmbComposite(optionWidget); m_cmbComposite = new KisCmbComposite(optionWidget);
...@@ -180,7 +180,7 @@ void KisToolPaint::addOptionWidgetOption(QWidget *control, QWidget *label) ...@@ -180,7 +180,7 @@ void KisToolPaint::addOptionWidgetOption(QWidget *control, QWidget *label)
m_optionWidgetLayout->addWidget(control, m_optionWidgetLayout->rowCount(), 0, 1, 2); m_optionWidgetLayout->addWidget(control, m_optionWidgetLayout->rowCount(), 0, 1, 2);
} }
void KisToolPaint::slotSetOpacity(double opacityPerCent, bool final) void KisToolPaint::slotSetOpacity(qreal opacityPerCent, bool final)
{ {
Q_UNUSED(final); Q_UNUSED(final);
m_opacity = (int)(opacityPerCent * OPACITY_OPAQUE / 100); m_opacity = (int)(opacityPerCent * OPACITY_OPAQUE / 100);
......
...@@ -99,7 +99,7 @@ private: ...@@ -99,7 +99,7 @@ private:
private slots: private slots:
void slotPopupQuickHelp(); void slotPopupQuickHelp();
void slotSetOpacity(double opacityPerCent, bool final); void slotSetOpacity(qreal opacityPerCent, bool final);
void slotSetCompositeMode(const KoCompositeOp* compositeOp); void slotSetCompositeMode(const KoCompositeOp* compositeOp);
protected: protected:
......
...@@ -541,8 +541,8 @@ void KisView2::createGUI() ...@@ -541,8 +541,8 @@ void KisView2::createGUI()
connect(m_d->layerBox, SIGNAL(sigRequestNodeProperties(KisNodeSP)), connect(m_d->layerBox, SIGNAL(sigRequestNodeProperties(KisNodeSP)),
m_d->nodeManager, SLOT(nodeProperties(KisNodeSP))); m_d->nodeManager, SLOT(nodeProperties(KisNodeSP)));
connect(m_d->layerBox, SIGNAL(sigOpacityChanged(double, bool)), connect(m_d->layerBox, SIGNAL(sigOpacityChanged(qreal, bool)),
m_d->nodeManager, SLOT(nodeOpacityChanged(double, bool))); m_d->nodeManager, SLOT(nodeOpacityChanged(qreal, bool)));
connect(m_d->layerBox, SIGNAL(sigItemComposite(const KoCompositeOp*)), connect(m_d->layerBox, SIGNAL(sigItemComposite(const KoCompositeOp*)),
m_d->nodeManager, SLOT(nodeCompositeOpChanged(const KoCompositeOp*))); m_d->nodeManager, SLOT(nodeCompositeOpChanged(const KoCompositeOp*)));
......
...@@ -67,10 +67,10 @@ public: ...@@ -67,10 +67,10 @@ public:
/** /**
* retrieve the grid size setting. * retrieve the grid size setting.
* The grid spacing will be provided in pt. * The grid spacing will be provided in pt.
* @param horizontal a pointer to a double that will be filled with the horizontal grid-spacing * @param horizontal a pointer to a qreal that will be filled with the horizontal grid-spacing
* @param vertical a pointer to a double that will be filled with the vertical grid-spacing * @param vertical a pointer to a qreal that will be filled with the vertical grid-spacing
*/ */
virtual void gridSize(double *horizontal, double *vertical) const = 0; virtual void gridSize(qreal *horizontal, qreal *vertical) const = 0;
/** /**
* return if snap to grid is enabled. * return if snap to grid is enabled.
......
...@@ -60,8 +60,8 @@ public: ...@@ -60,8 +60,8 @@ public:
QSize documentSize; QSize documentSize;
QPoint documentOffset; QPoint documentOffset;
Viewport * viewportWidget; Viewport * viewportWidget;
double preferredCenterFractionX; qreal preferredCenterFractionX;
double preferredCenterFractionY; qreal preferredCenterFractionY;
bool ignoreScrollSignals; bool ignoreScrollSignals;
}; };
...@@ -385,15 +385,15 @@ void KoCanvasController::zoomBy(const QPoint &center, qreal zoom ) ...@@ -385,15 +385,15 @@ void KoCanvasController::zoomBy(const QPoint &center, qreal zoom )
void KoCanvasController::zoomTo(const QRect &viewRect) void KoCanvasController::zoomTo(const QRect &viewRect)
{ {
double scale; qreal scale;
if(1.0 * viewport()->width() / viewRect.width() > 1.0 * viewport()->height() / viewRect.height()) if(1.0 * viewport()->width() / viewRect.width() > 1.0 * viewport()->height() / viewRect.height())
scale = 1.0 * viewport()->height() / viewRect.height(); scale = 1.0 * viewport()->height() / viewRect.height();
else else
scale = 1.0 * viewport()->width() / viewRect.width(); scale = 1.0 * viewport()->width() / viewRect.width();
const double preferredCenterFractionX = 1.0 * viewRect.center().x() / m_d->documentSize.width(); const qreal preferredCenterFractionX = 1.0 * viewRect.center().x() / m_d->documentSize.width();
const double preferredCenterFractionY = 1.0 * viewRect.center().y() / m_d->documentSize.height(); const qreal preferredCenterFractionY = 1.0 * viewRect.center().y() / m_d->documentSize.height();
emit zoomBy(scale); emit zoomBy(scale);
...@@ -572,7 +572,7 @@ void KoCanvasController::wheelEvent( QWheelEvent *event ) { ...@@ -572,7 +572,7 @@ void KoCanvasController::wheelEvent( QWheelEvent *event ) {
const QPoint offset( horizontalScrollBar()->value(), verticalScrollBar()->value() ); const QPoint offset( horizontalScrollBar()->value(), verticalScrollBar()->value() );
const QPoint mousePos( event->pos() + offset ); const QPoint mousePos( event->pos() + offset );
const double zoomLevel = event->delta() > 0 ? sqrt(2.0) : sqrt(0.5); const qreal zoomLevel = event->delta() > 0 ? sqrt(2.0) : sqrt(0.5);
QPointF oldCenter = preferredCenter(); QPointF oldCenter = preferredCenter();
if ( visibleWidth() >= m_d->documentSize.width() ) if ( visibleWidth() >= m_d->documentSize.width() )
......
...@@ -297,7 +297,7 @@ signals: ...@@ -297,7 +297,7 @@ signals:
* *
* @param factor by how much the zoom needs to change. * @param factor by how much the zoom needs to change.
*/ */
void zoomBy( const double factor ); void zoomBy( const qreal factor );
public slots: public slots:
......
...@@ -154,7 +154,7 @@ public: ...@@ -154,7 +154,7 @@ public:
int intResource(int key) const; int intResource(int key) const;
/** /**
* Return the resource determined by param key as a double. * Return the resource determined by param key as a qreal.
* @param key the indentifying key for the resource. * @param key the indentifying key for the resource.
*/ */
bool doubleResource(int key) const; bool doubleResource(int key) const;
......
...@@ -152,7 +152,7 @@ void KoConnectionShape::updatePath( const QSizeF &size ) ...@@ -152,7 +152,7 @@ void KoConnectionShape::updatePath( const QSizeF &size )
{ {
Q_UNUSED( size ); Q_UNUSED( size );
const double MinimumEscapeLength = 20.0; const qreal MinimumEscapeLength = 20.0;
clear(); clear();
switch( d->connectionType ) switch( d->connectionType )
...@@ -186,7 +186,7 @@ void KoConnectionShape::updatePath( const QSizeF &size ) ...@@ -186,7 +186,7 @@ void KoConnectionShape::updatePath( const QSizeF &size )
} }
// check if we are going toward the other handle // check if we are going toward the other handle
double sp = scalarProd( direction1, edgePoint2-edgePoint1 ); qreal sp = scalarProd( direction1, edgePoint2-edgePoint1 );
if( sp >= 0.0 ) if( sp >= 0.0 )
{ {
// if we are having the same direction, go all the way toward // if we are having the same direction, go all the way toward
...@@ -359,7 +359,7 @@ QPointF KoConnectionShape::escapeDirection( int handleId ) const ...@@ -359,7 +359,7 @@ QPointF KoConnectionShape::escapeDirection( int handleId ) const
else else
centerPoint = d->shape2->absolutePosition( KoFlake::CenteredPosition ); centerPoint = d->shape2->absolutePosition( KoFlake::CenteredPosition );
double angle = atan2( handlePoint.y()-centerPoint.y(), handlePoint.x()-centerPoint.x() ); qreal angle = atan2( handlePoint.y()-centerPoint.y(), handlePoint.x()-centerPoint.x() );
if( angle < 0.0 ) if( angle < 0.0 )
angle += 2.0*M_PI; angle += 2.0*M_PI;
angle *= 180.0 / M_PI; angle *= 180.0 / M_PI;
...@@ -383,16 +383,16 @@ QPointF KoConnectionShape::escapeDirection( int handleId ) const ...@@ -383,16 +383,16 @@ QPointF KoConnectionShape::escapeDirection( int handleId ) const
bool KoConnectionShape::intersects( const QPointF &p1, const QPointF &d1, const QPointF &p2, const QPointF &d2, QPointF &isect ) bool KoConnectionShape::intersects( const QPointF &p1, const QPointF &d1, const QPointF &p2, const QPointF &d2, QPointF &isect )
{ {
double sp1 = scalarProd( d1, p2-p1 ); qreal sp1 = scalarProd( d1, p2-p1 );
if( sp1 < 0.0 ) if( sp1 < 0.0 )
return false; return false;
double sp2 = scalarProd( d2, p1-p2 ); qreal sp2 = scalarProd( d2, p1-p2 );
if( sp2 < 0.0 ) if( sp2 < 0.0 )
return false; return false;
// use cross product to check if rays intersects at all // use cross product to check if rays intersects at all
double cp = crossProd( d1, d2 ); qreal cp = crossProd( d1, d2 );
if( cp == 0.0 ) if( cp == 0.0 )
{ {
// rays are parallel or coincidient // rays are parallel or coincidient
...@@ -418,12 +418,12 @@ bool KoConnectionShape::intersects( const QPointF &p1, const QPointF &d1, const ...@@ -418,12 +418,12 @@ bool KoConnectionShape::intersects( const QPointF &p1, const QPointF &d1, const
return true; return true;
} }
double KoConnectionShape::scalarProd( const QPointF &v1, const QPointF &v2 ) qreal KoConnectionShape::scalarProd( const QPointF &v1, const QPointF &v2 )
{ {
return v1.x()*v2.x() + v1.y()*v2.y(); return v1.x()*v2.x() + v1.y()*v2.y();
} }
double KoConnectionShape::crossProd( const QPointF &v1, const QPointF &v2 ) qreal KoConnectionShape::crossProd( const QPointF &v1, const QPointF &v2 )
{ {
return (v1.x()*v2.y() - v1.y()*v2.x() ); return (v1.x()*v2.y() - v1.y()*v2.x() );
} }
...@@ -431,7 +431,7 @@ double KoConnectionShape::crossProd( const QPointF &v1, const QPointF &v2 ) ...@@ -431,7 +431,7 @@ double KoConnectionShape::crossProd( const QPointF &v1, const QPointF &v2 )
QPointF KoConnectionShape::perpendicularDirection( const QPointF &p1, const QPointF &d1, const QPointF &p2 ) QPointF KoConnectionShape::perpendicularDirection( const QPointF &p1, const QPointF &d1, const QPointF &p2 )
{ {
QPointF perpendicular( d1.y(), -d1.x() ); QPointF perpendicular( d1.y(), -d1.x() );
double sp = scalarProd( perpendicular, p2-p1 ); qreal sp = scalarProd( perpendicular, p2-p1 );
if( sp < 0.0 ) if( sp < 0.0 )
perpendicular *= -1.0; perpendicular *= -1.0;
......
...@@ -105,8 +105,8 @@ private: ...@@ -105,8 +105,8 @@ private:
// reimplemented // reimplemented
virtual void notifyShapeChanged( KoShape * shape, ChangeType type ); virtual void notifyShapeChanged( KoShape * shape, ChangeType type );
double scalarProd( const QPointF &v1, const QPointF &v2 ); qreal scalarProd( const QPointF &v1, const QPointF &v2 );
double crossProd( const QPointF &v1, const QPointF &v2 ); qreal crossProd( const QPointF &v1, const QPointF &v2 );
struct Private; struct Private;
Private * const d; Private * const d;
......
...@@ -251,12 +251,12 @@ const QSizeF KoImageData:: imageSize() { ...@@ -251,12 +251,12 @@ const QSizeF KoImageData:: imageSize() {
image(); // make sure the image is loaded image(); // make sure the image is loaded
if(d->image.dotsPerMeterX()) if(d->image.dotsPerMeterX())
d->imageSize.setWidth( DM_TO_POINT(d->image.width() / (double) d->image.dotsPerMeterX() * 10.0) ); d->imageSize.setWidth( DM_TO_POINT(d->image.width() / (qreal) d->image.dotsPerMeterX() * 10.0) );
else else
d->imageSize.setWidth( d->image.width() / 72.0); d->imageSize.setWidth( d->image.width() / 72.0);
if(d->image.dotsPerMeterY()) if(d->image.dotsPerMeterY())
d->imageSize.setHeight( DM_TO_POINT(d->image.height() / (double) d->image.dotsPerMeterY() * 10.0) ); d->imageSize.setHeight( DM_TO_POINT(d->image.height() / (qreal) d->image.dotsPerMeterY() * 10.0) );
else else
d->imageSize.setHeight( d->image.height() / 72.0); d->imageSize.setHeight( d->image.height() / 72.0);
} }
......
...@@ -34,7 +34,7 @@ public: ...@@ -34,7 +34,7 @@ public:
* @param bottom the inset at the bottom * @param bottom the inset at the bottom
* @param right the inset at the right * @param right the inset at the right
*/ */
KoInsets(double top, double left, double bottom, double right) { KoInsets(qreal top, qreal left, qreal bottom, qreal right) {
this->top = top; this->top = top;
this->left = left; this->left = left;
this->bottom = bottom; this->bottom = bottom;
...@@ -46,10 +46,10 @@ public: ...@@ -46,10 +46,10 @@ public:
*/ */
KoInsets() : top(0.), bottom(0.), left(0.), right(0.) { KoInsets() : top(0.), bottom(0.), left(0.), right(0.) {
} }
double top; ///< Top inset qreal top; ///< Top inset
double bottom; ///< Bottom inset qreal bottom; ///< Bottom inset
double left; ///< Left inset qreal left; ///< Left inset
double right; ///< Right inset qreal right; ///< Right inset
}; };
#endif #endif
...@@ -51,7 +51,7 @@ KoLineBorder::KoLineBorder( const KoLineBorder & other ) ...@@ -51,7 +51,7 @@ KoLineBorder::KoLineBorder( const KoLineBorder & other )
d->brush = other.d->brush; d->brush = other.d->brush;
} }
KoLineBorder::KoLineBorder(double lineWidth, const QColor &color)