diff options
-rw-r--r-- | spline/spline-widget.cpp | 3 | ||||
-rw-r--r-- | video/video-widget.cpp | 5 | ||||
-rw-r--r-- | video/video-widget.hpp | 2 |
3 files changed, 4 insertions, 6 deletions
diff --git a/spline/spline-widget.cpp b/spline/spline-widget.cpp index 96a22d95..0ae3766d 100644 --- a/spline/spline-widget.cpp +++ b/spline/spline-widget.cpp @@ -155,8 +155,7 @@ void spline_widget::drawFunction() moving_control_point_idx < points.size()) { const QPen pen(Qt::white, 1, Qt::SolidLine, Qt::FlatCap); - const QPointF prev_ = point_to_pixel({}); - QPointF prev(iround(prev_.x()), iround(prev_.y())); + QPointF prev = point_to_pixel({}); for (const auto& point : points) { const QPointF tmp = point_to_pixel(point); diff --git a/video/video-widget.cpp b/video/video-widget.cpp index 4394fec7..9100e0ea 100644 --- a/video/video-widget.cpp +++ b/video/video-widget.cpp @@ -33,13 +33,12 @@ void video_widget::update_image(const QImage& img) set_fresh(true); } -void video_widget::set_image(const unsigned char* src, int width, int height, - unsigned stride, QImage::Format fmt) +void video_widget::set_image(const unsigned char* src, int width, int height, int stride, QImage::Format fmt) { QMutexLocker l(&mtx); texture = QImage(); - unsigned nbytes = stride * height; + unsigned nbytes = (unsigned)(stride * height); vec.resize(nbytes); vec.shrink_to_fit(); std::memcpy(vec.data(), src, nbytes); texture = QImage((const unsigned char*)vec.data(), width, height, stride, fmt); diff --git a/video/video-widget.hpp b/video/video-widget.hpp index ab5d42d2..bb218c69 100644 --- a/video/video-widget.hpp +++ b/video/video-widget.hpp @@ -36,7 +36,7 @@ protected: std::vector<unsigned char> vec; bool fresh() const; void set_fresh(bool x); - void set_image(const unsigned char* src, int width, int height, unsigned stride, QImage::Format fmt); + void set_image(const unsigned char* src, int width, int height, int stride, QImage::Format fmt); private: void init_image_nolock(); |