From f82bbc75f157e1901830a2e579dd2968e1ce46a9 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 3 Dec 2018 19:30:32 +0100 Subject: Fix failed cast in ColorWheel. --- src/ui/widget/ink-color-wheel.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src') diff --git a/src/ui/widget/ink-color-wheel.cpp b/src/ui/widget/ink-color-wheel.cpp index 09688eca9..db3890548 100644 --- a/src/ui/widget/ink-color-wheel.cpp +++ b/src/ui/widget/ink-color-wheel.cpp @@ -167,19 +167,12 @@ bool ColorWheel::on_draw(const::Cairo::RefPtr<::Cairo::Context>& cr) { Cairo::RefPtr surface = cr->get_target(); - Cairo::RefPtr image_surface = - Cairo::RefPtr::cast_dynamic(surface); - if (!image_surface) { - std::cerr << "ColorWheel::on_draw: Failed Cast!" << std::endl; - return false; - } Gtk::Allocation allocation = get_allocation(); const int width = allocation.get_width(); const int height = allocation.get_height(); - Cairo::Format format = image_surface->get_format(); - const int stride = Cairo::ImageSurface::format_stride_for_width(format, width); + const int stride = Cairo::ImageSurface::format_stride_for_width(Cairo::FORMAT_RGB24, width); int cx = width/2; int cy = height/2; -- cgit v1.2.3