~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/metanet/ge_set_winsize.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function ge_set_winsize(a)
 
2
//Copyright INRIA
 
3
//Author : Serge Steer 2002
 
4
 
 
5
  [lhs,rhs]=argn(0)
 
6
 
 
7
  rect=ge_dig_bound(GraphList);
 
8
  if rect<>[] then
 
9
    w=max(rect(3)-rect(1),1);
 
10
    h=max(rect(4)-rect(2),1);
 
11
    if rhs==0 then j=1.5;a=max(600/(j*w),400/(j*h),j); end
 
12
  else
 
13
    w=600;h=400;rect=[0,0,w,h];
 
14
    if rhs==0 then a=1.5; end
 
15
  end
 
16
 
 
17
 
 
18
  xbasc()
 
19
 
 
20
  xset("wresize",0);
 
21
  width=EGdata.Zoom*w*a;height=EGdata.Zoom*h*a
 
22
  xset('wdim',width,height);
 
23
  b=(1-1/a)/2;
 
24
  xsetech([b,b,1/a,1/a],rect)
 
25
  
 
26
  r=xget('wpdim');
 
27
  %XSHIFT=max((width-r(1))/2,0)
 
28
  %YSHIFT=max((height-r(2))/2,0)
 
29
  xset('viewport',%XSHIFT,%YSHIFT)
 
30
endfunction