setWindowIndirect method

bool setWindowIndirect(
  1. double left,
  2. double bottom,
  3. double right,
  4. double top,
)

Implementation

bool setWindowIndirect( double left, double bottom, double right, double top ){
	double sizeX, sizeY;

	if( ((sizeX = right - left) == 0.0) || ((sizeY = bottom - top) == 0.0) ){
		return false;
	}

	_ratioX  = (_width  - 1) / sizeX;
	_ratioY  = (_height - 1) / sizeY;
	_ratioX2 = (_ratioX >= 0.0) ? _ratioX : -_ratioX;
	_ratioY2 = (_ratioY >= 0.0) ? _ratioY : -_ratioY;
	_offsetX = 0.5 - left * _ratioX;
	_offsetY = 0.5 - top  * _ratioY;

	// 現在点を更新する
	_wndMoveX = wndPosX( _imgMoveX );
	_wndMoveY = wndPosY( _imgMoveY );

	return true;
}