add offset control

This commit is contained in:
Tonton Th
2026-04-23 22:22:04 +02:00
parent daa0d0765f
commit 485f2f646d

View File

@@ -1,4 +1,5 @@
! SPIRALING... ! THE GENPLOTTING MODULE
!
! new Thu Apr 23 01:13.37 PM UTC 2026 ! new Thu Apr 23 01:13.37 PM UTC 2026
! !
module genplotting module genplotting
@@ -31,23 +32,36 @@ subroutine genp_init (foo, fname)
xscale = 0.0 ; yscale = 0.0 xscale = 0.0 ; yscale = 0.0
end subroutine end subroutine
! --------------------------------------------------------- ! ---------------------------------------------------------
subroutine genp_set_offset(ox, oy)
real, intent(in) :: ox, oy
xoffset = ox ; yoffset = oy
end subroutine
subroutine genp_get_offset(ox, oy)
real, intent(out) :: ox, oy
ox = xoffset ; oy = yoffset
end subroutine
! ---------------------------------------------------------
subroutine genp_move (px, py) subroutine genp_move (px, py)
real, intent(in) :: px, py real, intent(in) :: px, py
write (outunit, '(2F12.5, I5)') px, py, -1 real :: lx, ly
if (px .lt. xmin) xmin = px lx = px + xoffset ; ly = py + yoffset
if (px .gt. xmax) xmax = px write (outunit, '(2F12.5, I5)') lx, ly, -1
if (py .lt. ymin) ymin = py if (lx .lt. xmin) xmin = lx
if (py .gt. ymax) ymax = py if (lx .gt. xmax) xmax = lx
if (ly .lt. ymin) ymin = ly
if (ly .gt. ymax) ymax = ly
end subroutine end subroutine
! --------------------------------------------------------- ! ---------------------------------------------------------
subroutine genp_draw (px, py, color) subroutine genp_draw (px, py, color)
real, intent(in) :: px, py real, intent(in) :: px, py
integer, intent(in) :: color integer, intent(in) :: color
write (outunit, '(2F12.5, I5)') px, py, color real :: lx, ly
if (px .lt. xmin) xmin = px lx = px + xoffset ; ly = py + yoffset
if (px .gt. xmax) xmax = px write (outunit, '(2F12.5, I5)') lx, ly, color
if (py .lt. ymin) ymin = py if (lx .lt. xmin) xmin = lx
if (py .gt. ymax) ymax = py if (lx .gt. xmax) xmax = lx
if (ly .lt. ymin) ymin = ly
if (ly .gt. ymax) ymax = ly
end subroutine end subroutine
! --------------------------------------------------------- ! ---------------------------------------------------------
! --------------------------------------------------------- ! ---------------------------------------------------------