~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to macros/scicos/window_set_size.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function window_set_size(a)
 
2
[lhs,rhs]=argn(0)
 
3
 
 
4
  rect=dig_bound(scs_m);
 
5
  if rect<>[] then
 
6
    xx=rect(1);
 
7
    yy=rect(2);
 
8
    w=rect(3)-rect(1);
 
9
    h=rect(4)-rect(2);
 
10
    if rhs==0 then j=1.5;a=max(600/(j*w),400/(j*h),j); end
 
11
else
 
12
    xx=0;yy=0;w=600;h=400;rect=[xx,yy,w,h];
 
13
    if rhs==0 then a=1.5; end
 
14
  end
 
15
 
 
16
 
 
17
  xbasc()
 
18
 
 
19
  xset("wresize",0);
 
20
width=%zoom*w*a;height=%zoom*h*a
 
21
  xset('wdim',width,height);
 
22
  b=(1-1/a)/2;
 
23
  xsetech([b,b,1/a,1/a],[rect(1),rect(2),rect(3),rect(4)])
 
24
  
 
25
  r=xget('wpdim');
 
26
  %XSHIFT=max((width-r(1))/2,0)
 
27
  %YSHIFT=max((height-r(2))/2,0)
 
28
  xset('viewport',%XSHIFT,%YSHIFT)