kopia lustrzana https://gitlab.com/Zwarf/picplanner
Porównaj commity
3 Commity
a07e2bedad
...
618ab33c46
Autor | SHA1 | Data |
---|---|---|
Zwarf | 618ab33c46 | |
Zwarf | aed0356c7c | |
Zwarf | f0a35b253b |
|
@ -6,4 +6,5 @@ Icon=de.zwarf.picplanner
|
|||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Categories=Graphics;GTK;Photography
|
||||
Categories=Graphics;GTK;Photography;
|
||||
X-Purism-FormFactor=Workstation;Mobile;
|
|
@ -194,6 +194,11 @@ double
|
|||
y = cos (declination) * sin (time_sidereal - right_ascension);
|
||||
|
||||
azimuth = atan2 (-y, -x);
|
||||
/*
|
||||
* Exclude negative results
|
||||
*/
|
||||
if (azimuth < 0)
|
||||
azimuth += 2*M_PI;
|
||||
|
||||
elevation = asin (sin (latitude) * sin (declination)
|
||||
+ cos (latitude) * cos (declination) * cos (time_sidereal - right_ascension));
|
||||
|
|
|
@ -56,6 +56,7 @@ update_marker_visibility (PicplannerDrawLayer *layer,
|
|||
ShumateMapSource *map_source;
|
||||
gboolean within_viewport;
|
||||
double x, y, min_size, x_offset, y_offset, x_marker_offset, y_marker_offset;
|
||||
double x_orig, y_orig, rot_angle;
|
||||
int marker_width, marker_height;
|
||||
int width, height;
|
||||
|
||||
|
@ -66,13 +67,19 @@ update_marker_visibility (PicplannerDrawLayer *layer,
|
|||
if (!map_source)
|
||||
return;
|
||||
|
||||
x = picplanner_marker_get_x (marker);
|
||||
y = picplanner_marker_get_y (marker);
|
||||
x_orig = picplanner_marker_get_x (marker);
|
||||
y_orig = picplanner_marker_get_y (marker);
|
||||
x_marker_offset = picplanner_marker_get_x_offset (marker);
|
||||
y_marker_offset = picplanner_marker_get_y_offset (marker);
|
||||
|
||||
width = gtk_widget_get_width (GTK_WIDGET (layer));
|
||||
height = gtk_widget_get_height (GTK_WIDGET (layer));
|
||||
rot_angle = shumate_viewport_get_rotation (viewport);
|
||||
|
||||
x = cos(rot_angle)*(x_orig-1./2.) - sin(rot_angle)*(y_orig-1./2.) + 1./2.;
|
||||
y = sin(rot_angle)*(x_orig-1./2.) + cos(rot_angle)*(y_orig-1./2.) + 1./2.;
|
||||
picplanner_marker_set_location (marker, x, y, x_marker_offset, y_marker_offset);
|
||||
//g_print("x_new %f, y_new %f\n",picplanner_marker_get_x (PICPLANNER_MARKER (child)), picplanner_marker_get_y (PICPLANNER_MARKER (child)));"
|
||||
|
||||
if (width<height)
|
||||
{
|
||||
|
@ -223,7 +230,10 @@ picplanner_draw_layer_snapshot (GtkWidget *widget,
|
|||
{
|
||||
PicplannerDrawLayer *self = (PicplannerDrawLayer *)widget;
|
||||
PicplannerDrawLayerPrivate *priv = picplanner_draw_layer_get_instance_private (self);
|
||||
ShumateViewport *viewport = shumate_layer_get_viewport (SHUMATE_LAYER(self));
|
||||
int width, height, min_size, x_offset, y_offset;
|
||||
double x, y, x_rot, y_rot;
|
||||
double rot_angle = shumate_viewport_get_rotation (viewport);
|
||||
cairo_t *cr;
|
||||
GtkWidget *child;
|
||||
|
||||
|
@ -257,10 +267,11 @@ picplanner_draw_layer_snapshot (GtkWidget *widget,
|
|||
|
||||
for (uint i = 0; i < priv->nodes_len; i++)
|
||||
{
|
||||
double x, y;
|
||||
x = priv->nodes_coordinates[i*2]*min_size+x_offset;
|
||||
y = priv->nodes_coordinates[i*2+1]*min_size+y_offset;
|
||||
cairo_line_to (cr, x, y);
|
||||
x_rot = cos(rot_angle)*(x-width/2) - sin(rot_angle)*(y-height/2) + width/2;
|
||||
y_rot = sin(rot_angle)*(x-width/2) + cos(rot_angle)*(y-height/2) + height/2;
|
||||
cairo_line_to (cr, x_rot, y_rot);
|
||||
}
|
||||
|
||||
if (priv->stroke)
|
||||
|
@ -329,6 +340,7 @@ picplanner_draw_layer_add_marker (PicplannerDrawLayer *layer,
|
|||
|
||||
gtk_widget_insert_before (GTK_WIDGET(marker), GTK_WIDGET (layer), NULL);
|
||||
update_marker_visibility (layer, marker);
|
||||
gtk_widget_queue_draw (GTK_WIDGET (layer));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -184,3 +184,4 @@ picplanner_marker_set_child (PicplannerMarker *marker,
|
|||
if (priv->child)
|
||||
gtk_widget_set_parent (priv->child, GTK_WIDGET (marker));
|
||||
}
|
||||
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
<child>
|
||||
<object class="AdwClamp" id="basic_information">
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<property name="margin-start">4</property>
|
||||
<property name="margin-end">4</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
|
@ -52,7 +52,7 @@
|
|||
<property name="column-homogeneous">false</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<property name="column-spacing">6</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="margin-start">8</property>
|
||||
<property name="margin-end">8</property>
|
||||
|
|
Ładowanie…
Reference in New Issue