forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

%gr[smooth4] or %gt[smooth8] not working

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Kenneth_Smith



Joined: 18 May 2012
Posts: 143
Location: Glasgow, Scotland.

PostPosted: Sun Nov 12, 2017 6:19 pm    Post subject: %gr[smooth4] or %gt[smooth8] not working Reply with quote

The following code runs fine. However if the smooth4 or smooth8 option for the %gr are used, parts of the drawing are not show. I am using the latest release of the compiler.

Code:
  program main
  implicit none
  integer view_graphics_cb
  integer i
  i = view_graphics_cb()
  end program main

  integer function view_graphics_cb()
  implicit none
  include<windows.ins>
  integer i
  integer, parameter :: gw = 400, gh = 400
    i = winio@('%gr&',gw,gh)
!$$$$$$     i = winio@('%gr[smooth4]&',gw,gh)     !Use one of these instead of the line above
!$$$$$$     i = winio@('%gr[smooth8]&',gw,gh)
    call SET_LINE_WIDTH@(1)
    call SET_LINE_STYLE@(PS_SOLID)
    call draw_ellipse@(gw/2, gh/2 + 0,  20, 20, rgb@(0,0,0))
    call draw_ellipse@(gw/2, gh/2 + 20, 20, 20, rgb@(0,0,0))
    call draw_filled_rectangle@(gw/2 - 50, 60,    gw/2 + 50, 70, rgb@(0,0,0))
    call draw_filled_rectangle@(gw/2 - 50, gh-60, gw/2 + 50, gh-70, rgb@(0,0,0))
    call draw_line_between@(gw/2, 60,    gw/2, gh/2-20, rgb@(0,0,0))
    call draw_line_between@(gw/2, gh-60, gw/2, gh/2+40, rgb@(0,0,0))
    i = winio@(' ')
    view_graphics_cb = 1
  end function view_graphics_cb
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



Joined: 18 May 2012
Posts: 143
Location: Glasgow, Scotland.

PostPosted: Sun Nov 12, 2017 7:46 pm    Post subject: Reply with quote

A better example, looks like a coordinate problem to me. Both the calls to draw_filled_rectangle@ define the same rectangle (I think ! - it's been a long day).

Code:
 
  integer function view_graphics_cb()
  include<windows.ins>
  integer i
  integer, parameter :: gw = 400, gh = 400
    i = winio@('%gr[smooth4]&',gw,gh)
    call SET_LINE_WIDTH@(1)
    call draw_rectangle@(150,  60, 250, 70,  rgb@(0,0,0))
   
!    call draw_filled_rectangle@(150, 340, 250, 330, rgb@(0,0,0))   !#### This does not work with [smooth4]
    call draw_filled_rectangle@(150, 330, 250, 340, rgb@(0,0,0))    !#### This does work with [smooth4]

    i = winio@(' ')
    view_graphics_cb = 1
  end function view_graphics_cb


draw_rectangle@ has the same issue.

Ken
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 598

PostPosted: Sun Nov 12, 2017 9:45 pm    Post subject: Reply with quote

I'm puzzled with the 2nd example Ken.
Are you saying changing the dimensions of he rectangle makes it work/not work ?
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 143
Location: Glasgow, Scotland.

PostPosted: Sun Nov 12, 2017 10:57 pm    Post subject: Reply with quote

John, it's the order in which the coordinates are entered.
One line defines Bottom Left and Top Right corners, whilst the other defines Top Left and Bottom Right. In only one case is the solid rectangle drawn:-



Both work without the smooth4 option.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5003
Location: Salford, UK

PostPosted: Mon Nov 13, 2017 8:16 am    Post subject: Reply with quote

Ah yes. This can be fixed but for the moment it is necessary to draw from the top left to the bottom right otherwise the width and/or height turns out to be negative.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5003
Location: Salford, UK

PostPosted: Mon Nov 13, 2017 9:39 am    Post subject: Reply with quote

This has now been fixed for the next release of the ClearWin+ library.
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 143
Location: Glasgow, Scotland.

PostPosted: Mon Nov 13, 2017 2:17 pm    Post subject: Reply with quote

Thanks Paul, it took me longer to understand what was going wrong than it did for you to fix! Ken
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 598

PostPosted: Tue Nov 14, 2017 8:44 pm    Post subject: Reply with quote

This post has inspired me ....

What's the difference between Paul Laidler and Paul Weller ?

1. Paul Weller is a forgotten mod while Paul Laidler forgot the mod Smile

2. Paul Laidler is a Bug-to-fix Collector while Paul Weller is a Butterfly Collector Smile Smile

ok I'll get me coat
... gosh what a contorted, contrived excuse to post some good music:-)

Enjoy Smile ....
https://www.youtube.com/watch?v=KObNG4B_yuo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group