⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 view6.c

📁 nucleus 文件系统,内核和彩色图形系统,在小系统上非常好用
💻 C
字号:
/*************************************************************************/
/*                                                                       */
/*         Copyright (c) 1997 - 1999 Accelerated Technology, Inc.        */
/*                                                                       */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the      */
/* subject matter of this material.  All manufacturing, reproduction,    */
/* use, and sales rights pertaining to this subject matter are governed  */
/* by the license agreement.  The recipient of this software implicitly  */
/* accepts the terms of the license.                                     */
/*                                                                       */
/*************************************************************************/

/*************************************************************************/
/*                                                                       */
/* FILE NAME                                            VERSION          */
/*                                                                       */
/*      VIEW6.c                                          1.9             */
/*                                                                       */
/* COMPONENT                                                             */
/*                                                                       */
/*      All                                                              */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This file contains the SetOrigin function.                       */
/*                                                                       */
/* AUTHOR                                                                */
/*                                                                       */
/*      Robert G. Burrill, Accelerated Technology, Inc.                  */
/*                                                                       */
/* DATA STRUCTURES                                                       */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* FUNCTIONS                                                             */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* DEPENDENCIES                                                          */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         NAME            DATE                    REMARKS               */
/*                                                                       */
/*                                                                       */
/*************************************************************************/

#include "meta_wnd.h"
#include "metconst.h"    /* MetaWINDOW Constant & Stucture Definitions */
#include "metports.h"    /* MetaWINDOW Port & Bitmap Definitions */
#include "grafdata.h"

/* Function SetOrigin sets the origin of the local coordinate system for
the current grafPort. SetOrigin() does not affect the immediate screen
image, nor the location and size of the grafPort; it affects where subsequent
writing operations appear within the grafPort.  SetOrigin updates the
coordinates of the portRect and clipRect limits.  Dependent the the port
origin location, upperleft or lowerleft, the SetOrigin SOX,SOY values define
the respective local coordinate values.  For example:

	If the port origin is set as upperleft, SOX,SOY defines the local top-left 
	corner coordinate of the grafPort.

	If the port origin is set as lowerleft, SOX,SOY defines the local bottom-left
	corner coordinate of the grafPort. */
void SetOrigin(int SOX, int SOY)
{
	void mwGblCoord(void);
	void mwGblPen(void);
	short wthX;
	short hgtY;

	wthX = thePort->portRect.Xmax - thePort->portRect.Xmin + SOX;
	hgtY = thePort->portRect.Ymax - thePort->portRect.Ymin + SOY;

	thePort->portRect.Xmin = SOX;
	grafPort.portRect.Xmin = SOX;
	thePort->portRect.Xmax = wthX;
	grafPort.portRect.Xmax = wthX;

	thePort->portRect.Ymin = SOY;
	grafPort.portRect.Ymin = SOY;
	thePort->portRect.Ymax = hgtY;
	grafPort.portRect.Ymax = hgtY;
					;
	wthX = thePort->portClip.Xmax - thePort->portClip.Xmin + SOX;
	hgtY = thePort->portClip.Ymax - thePort->portClip.Ymin + SOY;

	thePort->portClip.Xmin = SOX;
	grafPort.portClip.Xmin = SOX;
	thePort->portClip.Xmax = wthX;
	grafPort.portClip.Xmax = wthX;

	thePort->portClip.Ymin = SOY;
	grafPort.portClip.Ymin = SOY;
	thePort->portClip.Ymax = hgtY;
	grafPort.portClip.Ymax = hgtY;
					;
	mwGblCoord();	/* update coordinate xform data */

	mwGblPen();	/* update locX,Y */

	return;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -