Nicolas Winkler 5 年之前
父节点
当前提交
aa0cc2d188
共有 3 个文件被更改,包括 6 次插入6 次删除
  1. 1 1
      MandelWidget.cpp
  2. 4 4
      libmandel/CMakeLists.txt
  3. 1 1
      libmandel/src/mandel.cpp

+ 1 - 1
MandelWidget.cpp

@@ -711,7 +711,7 @@ void MandelWidget::wheelEvent(QWheelEvent* we)
     QOpenGLWidget::wheelEvent(we);
     float x = float(we->x()) / this->width();
     float y = float(we->y()) / this->height();
-    float scale = 1.0f - we->angleDelta().y() * 0.001f;
+    float scale = ::pow(0.9975, we->angleDelta().y());
     printf("scale: %f\n", double(scale));
     zoom(scale, x, y);
     we->accept();

+ 4 - 4
libmandel/CMakeLists.txt

@@ -20,10 +20,6 @@ find_path(MPFR_INCLUDES
 )
 find_library(MPFR_LIBRARIES mpfr PATHS $ENV{MPFR_DIR} ${LIB_INSTALL_DIR})
 
-if(MPFR_INCLUDES AND MPFR_LIBRARIES)
-    set(MPFR_FOUND TRUE)
-    target_compile_definitions(mandel PUBLIC WITH_MPFR)
-endif()
 
 set(CMAKE_CXX_STANDARD 17)
 
@@ -48,6 +44,10 @@ endif()
 
 add_library(mandel STATIC ${MandelSources})
 
+if(MPFR_INCLUDES AND MPFR_LIBRARIES)
+    set(MPFR_FOUND TRUE)
+    #target_compile_definitions(mandel PUBLIC WITH_MPFR)
+endif()
 
 if(OPENCL_FOUND)
     target_compile_definitions(mandel PUBLIC WITH_OPENCL)

+ 1 - 1
libmandel/src/mandel.cpp

@@ -81,7 +81,7 @@ MandelContext::MandelContext(void)
     //cpuGeneratorFixedp = std::make_unique<CpuGenerator<fixed<1, 3>>>();
 
     devices = createDevices();
-    if (devices.empty()) {
+    if (devices.empty() || true) {
         adaptiveGenerator = std::make_unique<AdaptiveGenerator>(cpuGeneratorFloat.get(), cpuGeneratorDouble.get());
     }
     else {