diff --git a/ctk-qreal_not_double.patch b/ctk-qreal_not_double.patch new file mode 100644 index 0000000..a2e4088 --- /dev/null +++ b/ctk-qreal_not_double.patch @@ -0,0 +1,28 @@ +Index: CTK-bdc8caca0458759e1672a94ca2857595d40f17b0/Libs/Widgets/ctkMaterialPropertyPreviewLabel.cpp +=================================================================== +--- CTK-bdc8caca0458759e1672a94ca2857595d40f17b0.orig/Libs/Widgets/ctkMaterialPropertyPreviewLabel.cpp ++++ CTK-bdc8caca0458759e1672a94ca2857595d40f17b0/Libs/Widgets/ctkMaterialPropertyPreviewLabel.cpp +@@ -295,7 +295,7 @@ void ctkMaterialPropertyPreviewLabel::dr + ref.setZ( 2.*normal.z()*dot - light.z()); + ref.normalize(); + +- qreal diffuseComp = qMax(diffuse * dot, 0.); ++ qreal diffuseComp = qMax(diffuse * dot, 0.); + + qreal specularDot = qMax(static_cast(QVector3D::dotProduct(ref, view)), static_cast(0)); + +@@ -315,10 +315,10 @@ void ctkMaterialPropertyPreviewLabel::dr + } + else + { +- rgba = qRgba(static_cast(qMin(255. * intensity.x() * opacity + qRed(rgba)*(1. - opacity), static_cast(255.))), +- static_cast(qMin(255. * intensity.y() * opacity + qGreen(rgba)*(1. - opacity), static_cast(255.))), +- static_cast(qMin(255. * intensity.z() * opacity + qBlue(rgba)*(1. - opacity), static_cast(255.))), +- static_cast(qMin(255. * opacity + qAlpha(rgba)*(1. - opacity), static_cast(255.)))); ++ rgba = qRgba(static_cast(qMin(255. * intensity.x() * opacity + qRed(rgba)*(1. - opacity), static_cast(255.))), ++ static_cast(qMin(255. * intensity.y() * opacity + qGreen(rgba)*(1. - opacity), static_cast(255.))), ++ static_cast(qMin(255. * intensity.z() * opacity + qBlue(rgba)*(1. - opacity), static_cast(255.))), ++ static_cast(qMin(255. * opacity + qAlpha(rgba)*(1. - opacity), static_cast(255.)))); + } + } + image.setPixel(i,j,rgba); diff --git a/ctk.spec b/ctk.spec index 659ea0e..49f76d7 100644 --- a/ctk.spec +++ b/ctk.spec @@ -11,6 +11,7 @@ Summary: The Commmon Toolkit for biomedical imaging License: ASL 2.0 URL: http://www.commontk.org Source0: https://github.com/commontk/CTK/archive/%{commit}.tar.gz#/CTK-%{commit}.tar.gz +Patch0: ctk-qreal_not_double.patch BuildRequires: gcc-c++ BuildRequires: cmake @@ -101,7 +102,7 @@ This package contains CTK developer documentation. %prep -%autosetup -n CTK-%{commit} +%autosetup -n CTK-%{commit} -p1 mkdir build