aspect_ratio Function

private function aspect_ratio(self)

The width / height of the window drawn: a host's (from resize), or of the window's own, as it is now.

Arguments

Type IntentOptional Attributes Name
class(WindowProxy), intent(in) :: self

Return Value real(kind=wp)


Calls

proc~~aspect_ratio~~CallsGraph proc~aspect_ratio aspect_ratio interface~vkf_viewer_size vkf_viewer_size proc~aspect_ratio->interface~vkf_viewer_size

Called by

proc~~aspect_ratio~~CalledByGraph proc~aspect_ratio aspect_ratio proc~place_camera place_camera proc~place_camera->proc~aspect_ratio proc~view_camera view_camera proc~view_camera->proc~aspect_ratio proc~cursor_ray WindowProxy%cursor_ray proc~cursor_ray->proc~view_camera proc~frame WindowProxy%frame proc~frame->proc~place_camera proc~dispatch_events dispatch_events proc~frame->proc~dispatch_events proc~screen_position WindowProxy%screen_position proc~screen_position->proc~view_camera proc~window_pick WindowProxy%window_pick proc~window_pick->proc~view_camera proc~drag_handle drag_handle proc~drag_handle->proc~cursor_ray proc~grab_handle grab_handle proc~grab_handle->proc~cursor_ray proc~hover_handle hover_handle proc~hover_handle->proc~window_pick proc~resize WindowProxy%resize proc~resize->proc~frame proc~run WindowProxy%run proc~run->proc~frame proc~dispatch_event dispatch_event proc~dispatch_event->proc~drag_handle proc~dispatch_event->proc~grab_handle proc~dispatch_event->proc~hover_handle proc~release_handle release_handle proc~dispatch_event->proc~release_handle proc~release_handle->proc~hover_handle proc~dispatch_events->proc~dispatch_event

Source Code

    real(wp) function aspect_ratio(self)
        class(WindowProxy), intent(in) :: self
        integer(c_int) :: width, height
        aspect_ratio = real(self%width_, wp) / real(self%height_, wp)
        if (self%hosted .or. .not. c_associated(self%viewer_)) return
        if (vkf_viewer_size(self%viewer_, width, height) /= 0) return
        if (width > 0 .and. height > 0) aspect_ratio = real(width, wp) / real(height, wp)
    end function aspect_ratio