lib/shoes/swt/image_pattern.rb in shoes-swt-4.0.0.pre9 vs lib/shoes/swt/image_pattern.rb in shoes-swt-4.0.0.pre10

- old
+ new

@@ -1,10 +1,11 @@ # frozen_string_literal: true class Shoes module Swt class ImagePattern include Common::Remove + include Common::ImageHandling def initialize(dsl) @dsl = dsl end @@ -14,11 +15,14 @@ end # Since colors are bound up (at least in specs) with image patterns, # we can't safely touch images during initialize, so lazily load them. def pattern - @image ||= ::Swt::Image.new(Shoes.display, @dsl.path) + @image ||= ::Swt::Image.new(Shoes.display, load_file_image_data(@dsl.path)) @pattern ||= ::Swt::Pattern.new(Shoes.display, @image) + cleanup_temporary_files + + @pattern end def apply_as_fill(gc, _dsl) gc.set_background_pattern pattern end