The Birdfont Source Code


All Repositories / birdfont.git / blob – RSS feed

ViewBox.vala in libsvgbird

This file is a part of the Birdfont project.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git

Revisions

View the latest version of libsvgbird/ViewBox.vala.
Apply css styles
1 /* 2 Copyright (C) 2016 Johan Mattsson 3 4 This library is free software; you can redistribute it and/or modify 5 it under the terms of the GNU Lesser General Public License as 6 published by the Free Software Foundation; either version 3 of the 7 License, or (at your option) any later version. 8 9 This library is distributed in the hope that it will be useful, but 10 WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 */ 14 15 16 using B; 17 using Cairo; 18 using Math; 19 20 namespace SvgBird { 21 22 public class ViewBox : GLib.Object { 23 24 public const uint NONE = 1; 25 public const uint XMIN = 1 << 1; 26 public const uint XMID = 1 << 2; 27 public const uint XMAX = 1 << 3; 28 public const uint YMIN = 1 << 4; 29 public const uint YMID = 1 << 5; 30 public const uint YMAX = 1 << 6; 31 32 public const uint XMIN_YMIN = XMIN | YMIN; 33 public const uint XMID_YMIN = XMID | YMIN; 34 public const uint XMAX_YMIN = XMAX | YMIN; 35 public const uint XMIN_YMID = XMIN | YMID; 36 public const uint XMID_YMID = XMID | YMID; 37 public const uint XMAX_YMID = XMAX | YMID; 38 public const uint XMIN_YMAX = XMIN | YMAX; 39 public const uint XMID_YMAX = XMID | YMAX; 40 public const uint XMAX_YMAX = XMAX | YMAX; 41 42 public double minx = 0; 43 public double miny = 0; 44 public double width = 0; 45 public double height = 0; 46 47 public uint alignment; 48 public bool slice; 49 50 public bool preserve_aspect_ratio; 51 52 public ViewBox (double minx, double miny, double width, double height, 53 uint alignment, bool slice, bool preserve_aspect_ratio) { 54 55 this.minx = minx; 56 this.miny = miny; 57 this.width = width; 58 this.height = height; 59 60 this.alignment = alignment; 61 this.slice = slice; 62 this.preserve_aspect_ratio = preserve_aspect_ratio; 63 } 64 65 } 66 67 } 68