mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-21 20:12:30 +00:00
Extend the interface with this function.
2008-07-11 Martin Nordholts <martinn@svn.gnome.org> * app/display/gimpdisplayshell-scroll.[ch] (gimp_display_shell_get_viewport): Extend the interface with this function. * app/display/gimpnavigationeditor.c (gimp_navigation_editor_update_marker): Use it here. svn path=/trunk/; revision=26114
This commit is contained in:
parent
7fee886d49
commit
06bd569012
11
ChangeLog
11
ChangeLog
|
@ -1,6 +1,15 @@
|
|||
2008-07-11 Martin Nordholts <martinn@svn.gnome.org>
|
||||
|
||||
* app/display/gimpdisplayshell-scroll.[ch]
|
||||
(gimp_display_shell_get_viewport): Extend the interface with this
|
||||
function.
|
||||
|
||||
* app/display/gimpnavigationeditor.c
|
||||
(gimp_navigation_editor_update_marker): Use it here.
|
||||
|
||||
2008-07-10 Martin Nordholts <martinn@svn.gnome.org>
|
||||
|
||||
* app/display/gimpdisplayshell-scroll.[ch]:
|
||||
* app/display/gimpdisplayshell-scroll.[ch]
|
||||
(gimp_display_shell_get_scaled_viewport): Extend the interface
|
||||
with this function
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell)
|
|||
*
|
||||
* Gets the viewport in screen coordinates, with origin at (0, 0) in
|
||||
* the image
|
||||
*
|
||||
**/
|
||||
void
|
||||
gimp_display_shell_get_scaled_viewport (GimpDisplayShell *shell,
|
||||
|
@ -157,3 +158,29 @@ gimp_display_shell_get_scaled_viewport (GimpDisplayShell *shell,
|
|||
if (w) *w = shell->disp_width;
|
||||
if (h) *h = shell->disp_height;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_display_shell_get_viewport:
|
||||
* @shell:
|
||||
* @x:
|
||||
* @y:
|
||||
* @w:
|
||||
* @h:
|
||||
*
|
||||
* Gets the viewport in image coordinates
|
||||
*
|
||||
* TODO: Handle when the viewport is zoomed out
|
||||
*
|
||||
**/
|
||||
void
|
||||
gimp_display_shell_get_viewport (GimpDisplayShell *shell,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
gdouble *w,
|
||||
gdouble *h)
|
||||
{
|
||||
if (x) *x = shell->offset_x / shell->scale_x;
|
||||
if (y) *y = shell->offset_y / shell->scale_y;
|
||||
if (w) *w = shell->disp_width / shell->scale_x;
|
||||
if (h) *h = shell->disp_height / shell->scale_y;
|
||||
}
|
||||
|
|
|
@ -32,5 +32,11 @@ void gimp_display_shell_get_scaled_viewport (GimpDisplayShell *shell,
|
|||
gint *w,
|
||||
gint *h);
|
||||
|
||||
void gimp_display_shell_get_viewport (GimpDisplayShell *shell,
|
||||
gdouble *x,
|
||||
gdouble *y,
|
||||
gdouble *w,
|
||||
gdouble *h);
|
||||
|
||||
|
||||
#endif /* __GIMP_DISPLAY_SHELL_SCROLL_H__ */
|
||||
|
|
|
@ -640,9 +640,13 @@ gimp_navigation_editor_update_marker (GimpNavigationEditor *editor)
|
|||
gimp_view_renderer_set_dot_for_dot (renderer, shell->dot_for_dot);
|
||||
|
||||
if (renderer->viewable)
|
||||
gimp_navigation_view_set_marker (GIMP_NAVIGATION_VIEW (editor->view),
|
||||
shell->offset_x / shell->scale_x,
|
||||
shell->offset_y / shell->scale_y,
|
||||
shell->disp_width / shell->scale_x,
|
||||
shell->disp_height / shell->scale_y);
|
||||
{
|
||||
GimpNavigationView *view = GIMP_NAVIGATION_VIEW (editor->view);
|
||||
gdouble x, y;
|
||||
gdouble w, h;
|
||||
|
||||
gimp_display_shell_get_viewport (shell, &x, &y, &w, &h);
|
||||
|
||||
gimp_navigation_view_set_marker (view, x, y, w, h);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue