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:

committed by
Martin Nordholts

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>
|
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
|
(gimp_display_shell_get_scaled_viewport): Extend the interface
|
||||||
with this function
|
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
|
* Gets the viewport in screen coordinates, with origin at (0, 0) in
|
||||||
* the image
|
* the image
|
||||||
|
*
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
gimp_display_shell_get_scaled_viewport (GimpDisplayShell *shell,
|
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 (w) *w = shell->disp_width;
|
||||||
if (h) *h = shell->disp_height;
|
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 *w,
|
||||||
gint *h);
|
gint *h);
|
||||||
|
|
||||||
|
void gimp_display_shell_get_viewport (GimpDisplayShell *shell,
|
||||||
|
gdouble *x,
|
||||||
|
gdouble *y,
|
||||||
|
gdouble *w,
|
||||||
|
gdouble *h);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_DISPLAY_SHELL_SCROLL_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);
|
gimp_view_renderer_set_dot_for_dot (renderer, shell->dot_for_dot);
|
||||||
|
|
||||||
if (renderer->viewable)
|
if (renderer->viewable)
|
||||||
gimp_navigation_view_set_marker (GIMP_NAVIGATION_VIEW (editor->view),
|
{
|
||||||
shell->offset_x / shell->scale_x,
|
GimpNavigationView *view = GIMP_NAVIGATION_VIEW (editor->view);
|
||||||
shell->offset_y / shell->scale_y,
|
gdouble x, y;
|
||||||
shell->disp_width / shell->scale_x,
|
gdouble w, h;
|
||||||
shell->disp_height / shell->scale_y);
|
|
||||||
|
gimp_display_shell_get_viewport (shell, &x, &y, &w, &h);
|
||||||
|
|
||||||
|
gimp_navigation_view_set_marker (view, x, y, w, h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user