@@ -90,7 +90,10 @@ function drawRoughnessGraph(canvas: HTMLCanvasElement): void {
9090 const rand = Alea ( PREVIEW_SEED ) ;
9191 const profile = makeRoughnessProfile ( rand , coastSettings . roughnessContrast ) ;
9292
93- const pl = 2 , pr = 2 , pt = 6 , pb = 6 ;
93+ const pl = 2 ,
94+ pr = 2 ,
95+ pt = 6 ,
96+ pb = 6 ;
9497 const gW = W - pl - pr ;
9598 const gH = H - pt - pb ;
9699 const thresh = Math . min ( Math . max ( coastSettings . smoothThreshold , 0 ) , 1 ) ;
@@ -125,7 +128,11 @@ function drawRoughnessGraph(canvas: HTMLCanvasElement): void {
125128 } ;
126129
127130 // Helper: stroke curve clipped to a horizontal band
128- const strokeBand = ( clipTop : number , clipBot : number , color : string ) : void => {
131+ const strokeBand = (
132+ clipTop : number ,
133+ clipBot : number ,
134+ color : string ,
135+ ) : void => {
129136 const h = clipBot - clipTop ;
130137 if ( h <= 0 ) return ;
131138 ctx . save ( ) ;
@@ -186,27 +193,41 @@ function drawShapePreview(canvas: HTMLCanvasElement): void {
186193
187194 // Generate at canvas scale so all setting changes are immediately visible.
188195 const basePts : [ number , number ] [ ] = [
189- [ cx , cy - r ] , // top
190- [ cx + r , cy ] , // right
191- [ cx , cy + r ] , // bottom
192- [ cx - r , cy ] , // left
196+ [ cx , cy - r ] , // top
197+ [ cx + r , cy ] , // right
198+ [ cx , cy + r ] , // bottom
199+ [ cx - r , cy ] , // left
193200 ] ;
194201
195202 const shape = fractalize ( basePts , Alea ( PREVIEW_SEED ) , coastSettings ) ;
196203 const path = new Path2D ( `${ buildCoastlinePath ( shape ) } Z` ) ;
197204
198205 // Ocean background — radial gradient, lighter at centre
199- const bgGrad = ctx . createRadialGradient ( cx , cy , 0 , cx , cy , Math . max ( W , H ) * 0.85 ) ;
206+ const bgGrad = ctx . createRadialGradient (
207+ cx ,
208+ cy ,
209+ 0 ,
210+ cx ,
211+ cy ,
212+ Math . max ( W , H ) * 0.85 ,
213+ ) ;
200214 bgGrad . addColorStop ( 0 , "#cce5f5" ) ;
201215 bgGrad . addColorStop ( 1 , "#6aa4cb" ) ;
202216 ctx . fillStyle = bgGrad ;
203217 ctx . fillRect ( 0 , 0 , W , H ) ;
204218
205219 // Land fill with drop shadow
206- const landGrad = ctx . createRadialGradient ( cx - r * 0.1 , cy - r * 0.1 , r * 0.05 , cx , cy , r * 1.1 ) ;
207- landGrad . addColorStop ( 0 , "#d8c87a" ) ;
220+ const landGrad = ctx . createRadialGradient (
221+ cx - r * 0.1 ,
222+ cy - r * 0.1 ,
223+ r * 0.05 ,
224+ cx ,
225+ cy ,
226+ r * 1.1 ,
227+ ) ;
228+ landGrad . addColorStop ( 0 , "#d8c87a" ) ;
208229 landGrad . addColorStop ( 0.5 , "#9cbc60" ) ;
209- landGrad . addColorStop ( 1 , "#5c8e40" ) ;
230+ landGrad . addColorStop ( 1 , "#5c8e40" ) ;
210231
211232 ctx . save ( ) ;
212233 ctx . shadowColor = "rgba(0,20,60,0.35)" ;
@@ -223,7 +244,7 @@ function drawShapePreview(canvas: HTMLCanvasElement): void {
223244 ctx . stroke ( path ) ;
224245
225246 // Original polygon skeleton — shows the raw 4-vertex input before fractalization
226- const origPts = shape . origIndices . map ( i => shape . points [ i ] ) ;
247+ const origPts = shape . origIndices . map ( ( i ) => shape . points [ i ] ) ;
227248 ctx . beginPath ( ) ;
228249 for ( let j = 0 ; j < origPts . length ; j ++ ) {
229250 const [ x , y ] = origPts [ j ] ;
@@ -256,7 +277,7 @@ function updatePreviews(): void {
256277}
257278
258279function buildDialogHTML ( ) : string {
259- const rows = SLIDER_DEFS . map ( ( { id, label, tip, min, max, step, key} ) => {
280+ const rows = SLIDER_DEFS . map ( ( { id, label, tip, min, max, step, key } ) => {
260281 const val = coastSettings [ key ] as number ;
261282 return /* html */ `
262283 <tr data-tip="${ tip } ">
@@ -300,10 +321,12 @@ function setupCoastlineEditor(): void {
300321 document . body . insertAdjacentHTML ( "beforeend" , buildDialogHTML ( ) ) ;
301322 }
302323
303- for ( const { id, key} of SLIDER_DEFS ) {
324+ for ( const { id, key } of SLIDER_DEFS ) {
304325 const slider = document . getElementById ( id ) as HTMLInputElement | null ;
305326 const output = document . getElementById ( `${ id } Out` ) as HTMLElement | null ;
306- const resetBtn = document . getElementById ( `${ id } Reset` ) as HTMLElement | null ;
327+ const resetBtn = document . getElementById (
328+ `${ id } Reset` ,
329+ ) as HTMLElement | null ;
307330
308331 if ( ! slider || ! output || ! resetBtn ) continue ;
309332
@@ -333,7 +356,7 @@ function setupCoastlineEditor(): void {
333356 title : "Coastline Advanced Settings" ,
334357 resizable : false ,
335358 width : "auto" ,
336- position : { my : "center" , at : "center" , of : "svg" } ,
359+ position : { my : "center" , at : "center" , of : "svg" } ,
337360 } ) ;
338361 } ;
339362}
0 commit comments