leon 1 ヶ月 前
コミット
09426f88bf
1 ファイル変更3 行追加3 行削除
  1. 3 3
      src/nodes/draw/position.hpp

+ 3 - 3
src/nodes/draw/position.hpp

@@ -115,9 +115,9 @@ public:
         std::tie(left, top, right, bottom) = box;
         left = std::max(0, left);
         top = std::max(0, top);
-        right = std::min(canvasWidth, right);
-        bottom = std::min(canvasHeight, bottom);
-        std::tuple<T, T, T, T> all = std::make_tuple(0, 0, canvasWidth, canvasHeight);
+        right = std::min(static_cast<T>(canvasWidth), right);
+        bottom = std::min(static_cast<T>(canvasHeight), bottom);
+        std::tuple<T, T, T, T> all = std::make_tuple(0, 0, static_cast<T>(canvasWidth), static_cast<T>(canvasHeight));
 
         // 一个框有6个可以画框的区域,判断那些区域没超过画面
         std::vector<std::tuple<T, T, T, T>> positions =