Skip to content

kasra-co/selectrect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SelectRect

A rectangular selection widget.

Usage

<SelectRect
	backgroundSrc={ "/images/some.jpg" }
	initialSelection={[ 0, 0, 600, 200 ]}
	scale={ 1 / 3 }
	updateSelection={
		function( x0, y0, x1, y1 ) {
			console.log( x0, y0, x1, y1 );
		}
	}
/>

backgroundSrc: URL of the background image. May be a base64 data url.

initialSelection: (optional) The initial

scale: The background image will be scaled by this factor. The coordinates passed to updateSelection will be compensated for this scaling, so that they can be used as is for a crop operation.

updateSelection: Called when the rectangular selection changes.

About

A React coordinates for making rectangular selections

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published