The Birdfont Source Code


All Repositories / birdfont.git / blobdiff – RSS feed

Speed optimization for rotation of raster images

Changes made to libbirdfont/ScaledBackgrounds.vala

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
--- libbirdfont/ScaledBackgrounds.vala +++ libbirdfont/ScaledBackgrounds.vala @@ -33,14 +33,6 @@ image = scale (scale_factor); scaled.add (image); } - } - - public ScaledBackgrounds.single_size (ImageSurface original, double scale_factor) { - this.original = original; - scaled = new ArrayList<ScaledBackground> (); - - ScaledBackground image = scale (scale_factor); - scaled.add (image); } public ScaledBackground get_image (double scale) { @@ -63,8 +55,9 @@ scale_factor = 1; } - int width = (int) (scale_factor * original.get_width ()); - int height = (int) (scale_factor * original.get_height ()); + int width = (int) (original.get_width () * scale_factor); + int height = (int) (original.get_height () * scale_factor); + scaled_image = new ImageSurface (Format.ARGB32, width, height); Context context = new Context (scaled_image); context.scale (scale_factor, scale_factor);