Compare commits
3 Commits
deceafb4f4
...
de291ffddb
Author | SHA1 | Date | |
---|---|---|---|
de291ffddb | |||
baaca4c58f | |||
7499f92811 |
@ -23,6 +23,7 @@ local render = function (cr)
|
|||||||
cr:curve_to (3, 0, 2, 2, 0, 2)
|
cr:curve_to (3, 0, 2, 2, 0, 2)
|
||||||
cr:line_to (-2, 2)
|
cr:line_to (-2, 2)
|
||||||
cr:curve_to (-1, 1, -1, -1, -2, -2)
|
cr:curve_to (-1, 1, -1, -1, -2, -2)
|
||||||
|
cr:close_path ()
|
||||||
cr:stroke ()
|
cr:stroke ()
|
||||||
|
|
||||||
-- The terminals
|
-- The terminals
|
||||||
|
@ -21,8 +21,7 @@ local render = function (cr)
|
|||||||
cr:line_to (-1, 0)
|
cr:line_to (-1, 0)
|
||||||
|
|
||||||
-- The terminals
|
-- The terminals
|
||||||
cr:move_to (-2, 0)
|
cr:line_to (-2, 0)
|
||||||
cr:line_to (-1, 0)
|
|
||||||
|
|
||||||
cr:move_to (1, 0)
|
cr:move_to (1, 0)
|
||||||
cr:line_to (2, 0)
|
cr:line_to (2, 0)
|
||||||
|
@ -48,7 +48,7 @@ local render = function (cr)
|
|||||||
cr:move_to (-1, -1)
|
cr:move_to (-1, -1)
|
||||||
cr:line_to (1, 0)
|
cr:line_to (1, 0)
|
||||||
cr:line_to (-1, 1)
|
cr:line_to (-1, 1)
|
||||||
cr:line_to (-1, -1)
|
cr:close_path ()
|
||||||
|
|
||||||
-- The vertical line
|
-- The vertical line
|
||||||
cr:move_to (1, 1)
|
cr:move_to (1, 1)
|
||||||
|
@ -42,7 +42,7 @@ local render = function (cr)
|
|||||||
cr:line_to (1.5, -0.5)
|
cr:line_to (1.5, -0.5)
|
||||||
cr:line_to (1.5, 0.5)
|
cr:line_to (1.5, 0.5)
|
||||||
cr:line_to (-1.5, 0.5)
|
cr:line_to (-1.5, 0.5)
|
||||||
cr:line_to (-1.5, -0.5)
|
cr:close_path ()
|
||||||
|
|
||||||
-- The terminals
|
-- The terminals
|
||||||
cr:move_to (-2, 0)
|
cr:move_to (-2, 0)
|
||||||
|
@ -712,9 +712,10 @@ diagram_save (LdWindowMain *self, GtkWindow *dialog_parent,
|
|||||||
static gboolean
|
static gboolean
|
||||||
diagram_open (LdWindowMain *self, const gchar *filename)
|
diagram_open (LdWindowMain *self, const gchar *filename)
|
||||||
{
|
{
|
||||||
GError *error;
|
GError *error = NULL;
|
||||||
|
GFile *file;
|
||||||
|
gchar *uri;
|
||||||
|
|
||||||
error = NULL;
|
|
||||||
ld_diagram_load_from_file (self->priv->diagram, filename, &error);
|
ld_diagram_load_from_file (self->priv->diagram, filename, &error);
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
@ -748,8 +749,17 @@ diagram_open (LdWindowMain *self, const gchar *filename)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file = g_file_new_for_path (filename);
|
||||||
|
uri = g_file_get_uri (file);
|
||||||
|
g_object_unref (file);
|
||||||
|
gtk_recent_manager_add_item (gtk_recent_manager_get_default (), uri);
|
||||||
|
g_free (uri);
|
||||||
|
|
||||||
ld_diagram_set_modified (self->priv->diagram, FALSE);
|
ld_diagram_set_modified (self->priv->diagram, FALSE);
|
||||||
diagram_set_filename (self, g_strdup (filename));
|
diagram_set_filename (self, g_strdup (filename));
|
||||||
|
|
||||||
|
ld_diagram_view_set_x (self->priv->view, 0);
|
||||||
|
ld_diagram_view_set_y (self->priv->view, 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user