@@ -68,6 +68,9 @@ ReactCountdownClock = CreateReactClass
6868 @_timer .textBaseline = ' middle'
6969 if @props .onClick ?
7070 @refs .component .addEventListener ' click' , @props .onClick
71+ if @props .scale ?
72+ @_background .scale (@props .scale , @props .scale )
73+ @_timer .scale (@props .scale , @props .scale )
7174
7275 _startTimer : ->
7376 # Give it a moment to collect it's thoughts for smoother render
@@ -174,9 +177,13 @@ ReactCountdownClock = CreateReactClass
174177 @_timer .fill ()
175178
176179 render : ->
177- <div ref = ' component' className = " react-countdown-clock" style = {width : @props .size , height : @props .size }>
178- <canvas ref = ' background' style = { position : ' absolute' } width = {@props .size } height = {@props .size }></canvas >
179- <canvas ref = ' timer' style = { position : ' absolute' } width = {@props .size } height = {@props .size }></canvas >
180+ width = @props .size * @props .scale
181+ height = @props .size * @props .scale
182+ style = { position : ' absolute' , width : width / 2 , height : height / 2 }
183+
184+ <div ref = ' component' className = " react-countdown-clock" style = {width : width, height : height}>
185+ <canvas ref = ' background' style = {style} width = {width} height = {height}></canvas >
186+ <canvas ref = ' timer' style = {style} width = {width} height = {height}></canvas >
180187 </div >
181188
182189ReactCountdownClock .propTypes =
@@ -193,6 +200,7 @@ ReactCountdownClock.propTypes =
193200 showMilliseconds : PropTypes .bool
194201 paused : PropTypes .bool
195202 pausedText : PropTypes .string
203+ scale : PropTypes .number
196204
197205ReactCountdownClock .defaultProps =
198206 seconds : 60
@@ -204,5 +212,6 @@ ReactCountdownClock.defaultProps =
204212 font : ' Arial'
205213 showMilliseconds : true
206214 paused : false
215+ scale : 1
207216
208217module .exports = ReactCountdownClock
0 commit comments