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
!
module genplotting
@@ -31,23 +32,36 @@ subroutine genp_init (foo, fname)
xscale = 0.0 ; yscale = 0.0
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)
real, intent(in) :: px, py
write (outunit, '(2F12.5, I5)') px, py, -1
if (px .lt. xmin) xmin = px
if (px .gt. xmax) xmax = px
if (py .lt. ymin) ymin = py
if (py .gt. ymax) ymax = py
real :: lx, ly
lx = px + xoffset ; ly = py + yoffset
write (outunit, '(2F12.5, I5)') lx, ly, -1
if (lx .lt. xmin) xmin = lx
if (lx .gt. xmax) xmax = lx
if (ly .lt. ymin) ymin = ly
if (ly .gt. ymax) ymax = ly
end subroutine
! ---------------------------------------------------------
subroutine genp_draw (px, py, color)
real, intent(in) :: px, py
integer, intent(in) :: color
write (outunit, '(2F12.5, I5)') px, py, color
if (px .lt. xmin) xmin = px
if (px .gt. xmax) xmax = px
if (py .lt. ymin) ymin = py
if (py .gt. ymax) ymax = py
real :: lx, ly
lx = px + xoffset ; ly = py + yoffset
write (outunit, '(2F12.5, I5)') lx, ly, color
if (lx .lt. xmin) xmin = lx
if (lx .gt. xmax) xmax = lx
if (ly .lt. ymin) ymin = ly
if (ly .gt. ymax) ymax = ly
end subroutine
! ---------------------------------------------------------
! ---------------------------------------------------------