Skip to content

Commit

Permalink
fix: fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
ppvan committed Apr 18, 2024
1 parent 6d01535 commit d223bc6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 51 deletions.
6 changes: 4 additions & 2 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ if not csv_dep.found()
libsimple_dep = libsimple_proj.get_variable('libcsv_deps')
endif

cc = meson.get_compiler('c')
math_dep = cc.find_library('m', required : false)


psequel_deps = [
dependency('glib-2.0', version: '>=2.74'),
Expand All @@ -93,9 +96,8 @@ psequel_deps = [
dependency('gtksourceview-5', version: '>= 5.0'),
dependency('libpq', version: '>= 15.3'),
dependency('sqlite3'),
dependency('libgvc'),
dependency('librsvg-2.0'),
csv_dep,
math_dep,
dependency('pgquery-vala'),
valac.find_library('config', dirs: vapi_dir),
]
Expand Down
2 changes: 1 addition & 1 deletion src/ui/widgets/TableGraph.vala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Rsvg;


namespace Psequel {
[GtkTemplate(ui = "/me/ppvan/psequel/gtk/table-graph.ui")]
Expand Down
48 changes: 0 additions & 48 deletions src/utils/helpers.vala
Original file line number Diff line number Diff line change
Expand Up @@ -79,52 +79,4 @@ public class MonospaceFilter : Gtk.Filter {
}
}


public class SvgPaintable : Gdk.Paintable, Object {
public uint8[] data { get; set; }
public Rsvg.Handle handle { get; private set; }

public SvgPaintable(uint8[] data) {
this.data = data;
this.handle = new Rsvg.Handle.from_data(this.data);
}


public void snapshot(Gdk.Snapshot snapshot, double width, double height) {
var gtkSnapshot = snapshot as Gtk.Snapshot;
Graphene.Rect rect = Graphene.Rect() {
};
rect = rect.init(0, 0, (float)width, (float)height);

var svgRect = Rsvg.Rectangle() {
x = 0,
y = 0,
width = width,
height = height
};


var cr = gtkSnapshot.append_cairo(rect);

try {
this.handle.render_document(cr, svgRect);
} catch (GLib.Error err) {
debug(err.message);
}
}

public int get_intrinsic_width() {
double width;
handle.get_intrinsic_size_in_pixels(out width, null);

return((int)Math.ceil(width));
}

public int get_intrinsic_height() {
double height;
handle.get_intrinsic_size_in_pixels(null, out height);

return((int)Math.ceil(height));
}
}
}

0 comments on commit d223bc6

Please sign in to comment.