File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
share/shutter/resources/modules/Shutter/Pixbuf Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,17 @@ sub set_quality_setting {
8080sub save_pdf_ps_svg {
8181 my $self = shift ;
8282 my $filename = shift ;
83+ my $filetype = shift ;
8384 my $pixbuf = shift ;
85+
86+ my $class = {
87+ pdf => ' Cairo::PdfSurface' ,
88+ ps => ' Cairo::PsSurface' ,
89+ svg => ' Cairo::SvgSurface' ,
90+ }-> {$filetype };
8491
8592 # 0.8? => 72 / 90 dpi
86- my $surface = Cairo::SvgSurface -> create($filename , $pixbuf -> get_width * 0.8, $pixbuf -> get_height * 0.8);
93+ my $surface = $class -> create($filename , $pixbuf -> get_width * 0.8, $pixbuf -> get_height * 0.8);
8794 my $cr = Cairo::Context-> create($surface );
8895 $cr -> scale(0.8, 0.8);
8996 Gtk3::Gdk::cairo_set_source_pixbuf($cr , $pixbuf , 0, 0);
@@ -175,7 +182,7 @@ sub save_pixbuf_to_file {
175182
176183 } elsif ($filetype eq ' pdf' || $filetype eq ' ps' || $filetype eq ' svg' ) {
177184
178- $self -> save_pdf_ps_svg($filename , $pixbuf );
185+ $self -> save_pdf_ps_svg($filename , $filetype , $ pixbuf );
179186
180187 print " Saving file $filename , $filetype \n " if $self -> {_common }-> get_debug;
181188
You can’t perform that action at this time.
0 commit comments