Skip to content

Commit

Permalink
Rename option into overviewHighlightRectanglePadding and add overview…
Browse files Browse the repository at this point in the history
…HighlightRectangleOpacity
  • Loading branch information
johvet authored and ziggythehamster committed Jul 2, 2015
1 parent b3b4888 commit 0a9a3ff
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ var options = {
// Colour for the overview waveform rectangle that shows what the zoom view shows
overviewHighlightRectangleColor: 'grey',

// Vertical padding in pixel to add to the overview waveform highlight rectangle. Defaults to 11px
overviewHighlightRectanglePadding: 11,

// Opacity of the overview waveform highlight rectangle. Defaults to 0.3
overviewHighlightRectangleOpacity: 0.3,

// Colour for segments on the waveform
segmentColor: 'rgba(255, 161, 39, 1)',

Expand Down Expand Up @@ -218,10 +224,6 @@ var options = {
// Zoom view adapter to use. Valid adapters are: 'animated' (default) and 'static'
zoomAdapter: 'animated',

// Vertical padding in pixel to add to the waveform reference rectangle. Defaults to 11px. You might want to adjust this
// depending on whether an axis is enabled in the overview waveform or not.
refWaveformRectPadding: 11,

// Array of initial segment objects with startTime and
// endTime in seconds and a boolean for editable.
// See below.
Expand Down
16 changes: 11 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ define('peaks', [
* Colour for the overview waveform
*/
overviewWaveformColor: 'rgba(0,0,0,0.2)',

/**
* Vertical padding in pixel to add to the overview waveform highlight rectangle. Defaults to 11px
*/
overviewHighlightRectanglePadding: 11,

/**
* Opacity of the overview waveform highlight rectangle. Defaults to 0.3
*/
overviewHighlightRectangleOpacity: 0.3,

/**
* Colour for the overview waveform highlight rectangle, which shows
* you what you see in the zoom view.
Expand Down Expand Up @@ -141,11 +152,6 @@ define('peaks', [
*/
overviewAxisGridlineColor: '#ccc',

/**
* Vertical padding in pixel to add to the waveform reference rectangle. Defaults to 11px
*/
refWaveformRectPadding: 11,

/**
*
*/
Expand Down
6 changes: 3 additions & 3 deletions src/main/views/waveform.overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ define([
strokeWidth: 0
});*/

var refPadding = this.options.refWaveformRectPadding;
var refPadding = this.options.overviewHighlightRectanglePadding;
if (refPadding * 2 > this.height) {
refPadding = 0;
}
Expand All @@ -137,8 +137,8 @@ define([
stroke: that.options.overviewHighlightRectangleColor,
strokeWidth: 1,
height: this.height - (refPadding * 2),
fill: that.options.overviewHighlightRectangleColor,
opacity: 0.3,
fill: this.options.overviewHighlightRectangleColor,
opacity: this.options.overviewHighlightRectangleOpacity,
cornerRadius: 2
});

Expand Down

0 comments on commit 0a9a3ff

Please sign in to comment.