Skip to content

Commit

Permalink
engine: remove #alpha_available?
Browse files Browse the repository at this point in the history
All rendering engines support alpha channel.
  • Loading branch information
kou committed Sep 15, 2024
1 parent 1ba996f commit 3bf1af2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
13 changes: 5 additions & 8 deletions lib/rabbit/gesture/handler.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2006-2017 Kouhei Sutou <kou@cozmixng.org>
# Copyright (C) 2006-2024 Sutou Kouhei <kou@cozmixng.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -93,13 +93,10 @@ def draw_last_locus(renderer)
end

def draw(renderer)
if @back_color.alpha == 1.0 or
(@back_color.alpha < 1.0 and renderer.alpha_available?)
size = renderer.size
args = [true, 0, 0, size.real_width, size.real_height]
args << @back_color
renderer.draw_rectangle(*args)
end
size = renderer.size
renderer.draw_rectangle(true,
0, 0, size.real_width, size.real_height,
@back_color)

draw_available_marks(renderer, next_available_motions)

Expand Down
4 changes: 0 additions & 4 deletions lib/rabbit/renderer/engine/cairo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ module Cairo

attr_writer :foreground, :background

def alpha_available?
true
end

def background_image=(pixbuf)
surface = ::Cairo::ImageSurface.new(::Cairo::FORMAT_A1, 1, 1)
context = ::Cairo::Context.new(surface)
Expand Down

0 comments on commit 3bf1af2

Please sign in to comment.