@@ -118,7 +118,7 @@ |
||
118 | 118 | if (Image::canManipulateAsImage($finalFormat) |
119 | 119 | && Image::canManipulateAsImage($finalFormat) |
120 | 120 | && $asset->height > 0) { |
121 | - $variant = [ |
|
121 | + $variant = [ |
|
122 | 122 | 'width' => $asset->width, |
123 | 123 | 'useAspectRatio' => false, |
124 | 124 | 'aspectRatioX' => $asset->width, |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | . "style='background:$color' " |
67 | 67 | . "/>"; |
68 | 68 | |
69 | - return $header . ImageOptimize::$plugin->optimizedImages->encodeOptimizedSVGDataUri($content); |
|
69 | + return $header.ImageOptimize::$plugin->optimizedImages->encodeOptimizedSVGDataUri($content); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -244,14 +244,14 @@ discard block |
||
244 | 244 | $config->preserveExifData = $oldPreserveExifData; |
245 | 245 | |
246 | 246 | // Save the image out to a temp file, then return its contents |
247 | - $tempFilename = uniqid(pathinfo($pathParts['filename'], PATHINFO_FILENAME), true) . '.' . 'jpg'; |
|
248 | - $tempPath = Craft::$app->getPath()->getTempPath() . DIRECTORY_SEPARATOR . $tempFilename; |
|
247 | + $tempFilename = uniqid(pathinfo($pathParts['filename'], PATHINFO_FILENAME), true).'.'.'jpg'; |
|
248 | + $tempPath = Craft::$app->getPath()->getTempPath().DIRECTORY_SEPARATOR.$tempFilename; |
|
249 | 249 | clearstatcache(true, $tempPath); |
250 | 250 | try { |
251 | 251 | $image->saveAs($tempPath); |
252 | 252 | } catch (ImageException $e) { |
253 | 253 | Craft::error( |
254 | - 'Error saving temporary image: ' . $e->getMessage(), |
|
254 | + 'Error saving temporary image: '.$e->getMessage(), |
|
255 | 255 | __METHOD__ |
256 | 256 | ); |
257 | 257 | } |
@@ -53,8 +53,8 @@ |
||
53 | 53 | // It takes a bit of time, so if you never plan to use it, you can turn it off |
54 | 54 | 'createColorPalette' => true, |
55 | 55 | |
56 | - // Controls whether SVG placeholder silhouettes should be created for image variants |
|
57 | - // It takes a bit of time, so if you never plan to use them, you can turn it off |
|
56 | + // Controls whether SVG placeholder silhouettes should be created for image variants |
|
57 | + // It takes a bit of time, so if you never plan to use them, you can turn it off |
|
58 | 58 | 'createPlaceholderSilhouettes' => true, |
59 | 59 | |
60 | 60 | // Controls whether retina images are automatically created with reduced quality |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | return $this->defaultPlaceholderImage(); |
291 | 291 | } |
292 | 292 | |
293 | - return Template::raw($header . rawurlencode($content)); |
|
293 | + return Template::raw($header.rawurlencode($content)); |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | /** |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | return $this->defaultPlaceholderImage(); |
346 | 346 | } |
347 | 347 | |
348 | - return Template::raw($header . $content); |
|
348 | + return Template::raw($header.$content); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | /** |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | break; |
455 | 455 | } |
456 | 456 | if ($match) { |
457 | - $subset+= array_slice($set, $index, 1, true); |
|
457 | + $subset += array_slice($set, $index, 1, true); |
|
458 | 458 | } |
459 | 459 | $index++; |
460 | 460 | } |
@@ -482,9 +482,9 @@ discard block |
||
482 | 482 | $descriptor = '3x'; |
483 | 483 | } |
484 | 484 | } else { |
485 | - $descriptor = $key . 'w'; |
|
485 | + $descriptor = $key.'w'; |
|
486 | 486 | } |
487 | - $srcset .= $value . ' ' . $descriptor . ', '; |
|
487 | + $srcset .= $value.' '.$descriptor.', '; |
|
488 | 488 | } |
489 | 489 | $srcset = rtrim($srcset, ', '); |
490 | 490 |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | Event::on( |
113 | 113 | CraftVariable::class, |
114 | 114 | CraftVariable::EVENT_INIT, |
115 | - function (Event $event) { |
|
115 | + function(Event $event) { |
|
116 | 116 | /** @var CraftVariable $variable */ |
117 | 117 | $variable = $event->sender; |
118 | 118 | $variable->set('imageOptimize', ImageOptimizeVariable::class); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | Event::on( |
124 | 124 | Fields::class, |
125 | 125 | Fields::EVENT_REGISTER_FIELD_TYPES, |
126 | - function (RegisterComponentTypesEvent $event) { |
|
126 | + function(RegisterComponentTypesEvent $event) { |
|
127 | 127 | Craft::debug( |
128 | 128 | 'Fields::EVENT_REGISTER_FIELD_TYPES', |
129 | 129 | __METHOD__ |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | Event::on( |
137 | 137 | Fields::class, |
138 | 138 | Fields::EVENT_AFTER_SAVE_FIELD, |
139 | - function (FieldEvent $event) { |
|
139 | + function(FieldEvent $event) { |
|
140 | 140 | Craft::debug( |
141 | 141 | 'Fields::EVENT_AFTER_SAVE_FIELD', |
142 | 142 | __METHOD__ |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | Event::on( |
175 | 175 | Plugins::class, |
176 | 176 | Plugins::EVENT_AFTER_SAVE_PLUGIN_SETTINGS, |
177 | - function (PluginEvent $event) { |
|
177 | + function(PluginEvent $event) { |
|
178 | 178 | if ($event->plugin === $this) { |
179 | 179 | Craft::debug( |
180 | 180 | 'Plugins::EVENT_AFTER_SAVE_PLUGIN_SETTINGS', |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | Event::on( |
194 | 194 | Volumes::class, |
195 | 195 | Volumes::EVENT_AFTER_SAVE_VOLUME, |
196 | - function (VolumeEvent $event) { |
|
196 | + function(VolumeEvent $event) { |
|
197 | 197 | Craft::debug( |
198 | 198 | 'Volumes::EVENT_AFTER_SAVE_VOLUME', |
199 | 199 | __METHOD__ |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | Event::on( |
215 | 215 | Assets::class, |
216 | 216 | Assets::EVENT_GET_ASSET_URL, |
217 | - function (GetAssetUrlEvent $event) { |
|
217 | + function(GetAssetUrlEvent $event) { |
|
218 | 218 | Craft::debug( |
219 | 219 | 'Assets::EVENT_GET_ASSET_URL', |
220 | 220 | __METHOD__ |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | Event::on( |
231 | 231 | AssetTransforms::class, |
232 | 232 | AssetTransforms::EVENT_GENERATE_TRANSFORM, |
233 | - function (GenerateTransformEvent $event) { |
|
233 | + function(GenerateTransformEvent $event) { |
|
234 | 234 | Craft::debug( |
235 | 235 | 'AssetTransforms::EVENT_GENERATE_TRANSFORM', |
236 | 236 | __METHOD__ |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | Event::on( |
247 | 247 | AssetTransforms::class, |
248 | 248 | AssetTransforms::EVENT_AFTER_DELETE_TRANSFORMS, |
249 | - function (AssetTransformImageEvent $event) { |
|
249 | + function(AssetTransformImageEvent $event) { |
|
250 | 250 | Craft::debug( |
251 | 251 | 'AssetTransforms::EVENT_AFTER_DELETE_TRANSFORMS', |
252 | 252 | __METHOD__ |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | Event::on( |
263 | 263 | Elements::class, |
264 | 264 | Elements::EVENT_BEFORE_SAVE_ELEMENT, |
265 | - function (ElementEvent $event) { |
|
265 | + function(ElementEvent $event) { |
|
266 | 266 | Craft::debug( |
267 | 267 | 'Elements::EVENT_BEFORE_SAVE_ELEMENT', |
268 | 268 | __METHOD__ |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | Event::on( |
288 | 288 | Elements::class, |
289 | 289 | Elements::EVENT_BEFORE_DELETE_ELEMENT, |
290 | - function (ElementEvent $event) { |
|
290 | + function(ElementEvent $event) { |
|
291 | 291 | Craft::debug( |
292 | 292 | 'Elements::EVENT_BEFORE_DELETE_ELEMENT', |
293 | 293 | __METHOD__ |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | Event::on( |
312 | 312 | Assets::class, |
313 | 313 | Assets::EVENT_BEFORE_REPLACE_ASSET, |
314 | - function (ReplaceAssetEvent $event) { |
|
314 | + function(ReplaceAssetEvent $event) { |
|
315 | 315 | Craft::debug( |
316 | 316 | 'Assets::EVENT_BEFORE_REPLACE_ASSET', |
317 | 317 | __METHOD__ |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | Event::on( |
334 | 334 | Assets::class, |
335 | 335 | Assets::EVENT_AFTER_REPLACE_ASSET, |
336 | - function (ReplaceAssetEvent $event) { |
|
336 | + function(ReplaceAssetEvent $event) { |
|
337 | 337 | Craft::debug( |
338 | 338 | 'Assets::EVENT_AFTER_REPLACE_ASSET', |
339 | 339 | __METHOD__ |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | Event::on( |
349 | 349 | Plugins::class, |
350 | 350 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
351 | - function (PluginEvent $event) { |
|
351 | + function(PluginEvent $event) { |
|
352 | 352 | if ($event->plugin === $this) { |
353 | 353 | $request = Craft::$app->getRequest(); |
354 | 354 | if (($request->isCpRequest) && (!$request->isConsoleRequest)) { |
@@ -182,12 +182,12 @@ discard block |
||
182 | 182 | |
183 | 183 | public function __construct() |
184 | 184 | { |
185 | - $this->info = (object)$this->info; |
|
185 | + $this->info = (object) $this->info; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | public function setParameter($data) |
189 | 189 | { |
190 | - $this->info = (object)array_merge((array)$this->info, $data); |
|
190 | + $this->info = (object) array_merge((array) $this->info, $data); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | public function loadImageFromFile($file) |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $bm1 = clone $bm; |
217 | 217 | $currentPoint = new Point(0, 0); |
218 | 218 | |
219 | - $findNext = function ($point) use ($bm1) { |
|
219 | + $findNext = function($point) use ($bm1) { |
|
220 | 220 | $i = $bm1->w * $point->y + $point->x; |
221 | 221 | while ($i < $bm1->size && $bm1->data[$i] !== 1) { |
222 | 222 | $i++; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | return 0; |
229 | 229 | }; |
230 | 230 | |
231 | - $majority = function ($x, $y) use ($bm1) { |
|
231 | + $majority = function($x, $y) use ($bm1) { |
|
232 | 232 | for ($i = 2; $i < 5; $i++) { |
233 | 233 | $ct = 0; |
234 | 234 | for ($a = -$i + 1; $a <= $i - 1; $a++) { |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | return 0; |
248 | 248 | }; |
249 | 249 | |
250 | - $findPath = function ($point) use ($bm, $bm1, $majority, $info) { |
|
250 | + $findPath = function($point) use ($bm, $bm1, $majority, $info) { |
|
251 | 251 | $path = new Path(); |
252 | 252 | $x = $point->x; |
253 | 253 | $y = $point->y; |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | return $path; |
312 | 312 | }; |
313 | 313 | |
314 | - $xorPath = function ($path) use (&$bm1) { |
|
314 | + $xorPath = function($path) use (&$bm1) { |
|
315 | 315 | $y1 = $path->pt[0]->y; |
316 | 316 | $len = $path->len; |
317 | 317 | |
@@ -345,15 +345,15 @@ discard block |
||
345 | 345 | { |
346 | 346 | $info = $this->info; |
347 | 347 | |
348 | - $mod = function ($a, $n) { |
|
348 | + $mod = function($a, $n) { |
|
349 | 349 | return $a >= $n ? $a % $n : ($a >= 0 ? $a : $n - 1 - (-1 - $a) % $n); |
350 | 350 | }; |
351 | 351 | |
352 | - $xprod = function ($p1, $p2) { |
|
352 | + $xprod = function($p1, $p2) { |
|
353 | 353 | return $p1->x * $p2->y - $p1->y * $p2->x; |
354 | 354 | }; |
355 | 355 | |
356 | - $cyclic = function ($a, $b, $c) { |
|
356 | + $cyclic = function($a, $b, $c) { |
|
357 | 357 | if ($a <= $c) { |
358 | 358 | return ($a <= $b && $b < $c); |
359 | 359 | } else { |
@@ -361,11 +361,11 @@ discard block |
||
361 | 361 | } |
362 | 362 | }; |
363 | 363 | |
364 | - $sign = function ($i) { |
|
364 | + $sign = function($i) { |
|
365 | 365 | return $i > 0 ? 1 : ($i < 0 ? -1 : 0); |
366 | 366 | }; |
367 | 367 | |
368 | - $quadform = function ($Q, $w) { |
|
368 | + $quadform = function($Q, $w) { |
|
369 | 369 | $v = array_fill(0, 3, null); |
370 | 370 | |
371 | 371 | $v[0] = $w->x; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | return $sum; |
383 | 383 | }; |
384 | 384 | |
385 | - $interval = function ($lambda, $a, $b) { |
|
385 | + $interval = function($lambda, $a, $b) { |
|
386 | 386 | $res = new Point(); |
387 | 387 | |
388 | 388 | $res->x = $a->x + $lambda * ($b->x - $a->x); |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | return $res; |
392 | 392 | }; |
393 | 393 | |
394 | - $dorth_infty = function ($p0, $p2) use ($sign) { |
|
394 | + $dorth_infty = function($p0, $p2) use ($sign) { |
|
395 | 395 | $r = new Point(); |
396 | 396 | |
397 | 397 | $r->y = $sign($p2->x - $p0->x); |
@@ -400,13 +400,13 @@ discard block |
||
400 | 400 | return $r; |
401 | 401 | }; |
402 | 402 | |
403 | - $ddenom = function ($p0, $p2) use ($dorth_infty) { |
|
403 | + $ddenom = function($p0, $p2) use ($dorth_infty) { |
|
404 | 404 | $r = $dorth_infty($p0, $p2); |
405 | 405 | |
406 | 406 | return $r->y * ($p2->x - $p0->x) - $r->x * ($p2->y - $p0->y); |
407 | 407 | }; |
408 | 408 | |
409 | - $dpara = function ($p0, $p1, $p2) { |
|
409 | + $dpara = function($p0, $p1, $p2) { |
|
410 | 410 | $x1 = $p1->x - $p0->x; |
411 | 411 | $y1 = $p1->y - $p0->y; |
412 | 412 | $x2 = $p2->x - $p0->x; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | return $x1 * $y2 - $x2 * $y1; |
416 | 416 | }; |
417 | 417 | |
418 | - $cprod = function ($p0, $p1, $p2, $p3) { |
|
418 | + $cprod = function($p0, $p1, $p2, $p3) { |
|
419 | 419 | $x1 = $p1->x - $p0->x; |
420 | 420 | $y1 = $p1->y - $p0->y; |
421 | 421 | $x2 = $p3->x - $p2->x; |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | return $x1 * $y2 - $x2 * $y1; |
425 | 425 | }; |
426 | 426 | |
427 | - $iprod = function ($p0, $p1, $p2) { |
|
427 | + $iprod = function($p0, $p1, $p2) { |
|
428 | 428 | $x1 = $p1->x - $p0->x; |
429 | 429 | $y1 = $p1->y - $p0->y; |
430 | 430 | $x2 = $p2->x - $p0->x; |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | return $x1 * $x2 + $y1 * $y2; |
434 | 434 | }; |
435 | 435 | |
436 | - $iprod1 = function ($p0, $p1, $p2, $p3) { |
|
436 | + $iprod1 = function($p0, $p1, $p2, $p3) { |
|
437 | 437 | $x1 = $p1->x - $p0->x; |
438 | 438 | $y1 = $p1->y - $p0->y; |
439 | 439 | $x2 = $p3->x - $p2->x; |
@@ -442,11 +442,11 @@ discard block |
||
442 | 442 | return $x1 * $x2 + $y1 * $y2; |
443 | 443 | }; |
444 | 444 | |
445 | - $ddist = function ($p, $q) { |
|
445 | + $ddist = function($p, $q) { |
|
446 | 446 | return sqrt(($p->x - $q->x) * ($p->x - $q->x) + ($p->y - $q->y) * ($p->y - $q->y)); |
447 | 447 | }; |
448 | 448 | |
449 | - $bezier = function ($t, $p0, $p1, $p2, $p3) { |
|
449 | + $bezier = function($t, $p0, $p1, $p2, $p3) { |
|
450 | 450 | $s = 1 - $t; |
451 | 451 | $res = new Point(); |
452 | 452 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | return $res; |
457 | 457 | }; |
458 | 458 | |
459 | - $tangent = function ($p0, $p1, $p2, $p3, $q0, $q1) use ($cprod) { |
|
459 | + $tangent = function($p0, $p1, $p2, $p3, $q0, $q1) use ($cprod) { |
|
460 | 460 | $A = $cprod($p0, $p1, $q0, $q1); |
461 | 461 | $B = $cprod($p1, $p2, $q0, $q1); |
462 | 462 | $C = $cprod($p2, $p3, $q0, $q1); |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | } |
488 | 488 | }; |
489 | 489 | |
490 | - $calcSums = function (&$path) { |
|
490 | + $calcSums = function(&$path) { |
|
491 | 491 | $path->x0 = $path->pt[0]->x; |
492 | 492 | $path->y0 = $path->pt[0]->y; |
493 | 493 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | } |
503 | 503 | }; |
504 | 504 | |
505 | - $calcLon = function (&$path) use ($mod, $xprod, $sign, $cyclic) { |
|
505 | + $calcLon = function(&$path) use ($mod, $xprod, $sign, $cyclic) { |
|
506 | 506 | $n = $path->len; |
507 | 507 | $pt = &$path->pt; |
508 | 508 | $pivk = array_fill(0, $n, null); |
@@ -613,9 +613,9 @@ discard block |
||
613 | 613 | } |
614 | 614 | }; |
615 | 615 | |
616 | - $bestPolygon = function (&$path) use ($mod) { |
|
616 | + $bestPolygon = function(&$path) use ($mod) { |
|
617 | 617 | |
618 | - $penalty3 = function ($path, $i, $j) { |
|
618 | + $penalty3 = function($path, $i, $j) { |
|
619 | 619 | $n = $path->len; |
620 | 620 | $pt = $path->pt; |
621 | 621 | $sums = $path->sums; |
@@ -721,9 +721,9 @@ discard block |
||
721 | 721 | } |
722 | 722 | }; |
723 | 723 | |
724 | - $adjustVertices = function (&$path) use ($mod, $quadform) { |
|
724 | + $adjustVertices = function(&$path) use ($mod, $quadform) { |
|
725 | 725 | |
726 | - $pointslope = function ($path, $i, $j, &$ctr, &$dir) { |
|
726 | + $pointslope = function($path, $i, $j, &$ctr, &$dir) { |
|
727 | 727 | |
728 | 728 | $n = $path->len; |
729 | 729 | $sums = $path->sums; |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | } |
929 | 929 | }; |
930 | 930 | |
931 | - $reverse = function (&$path) { |
|
931 | + $reverse = function(&$path) { |
|
932 | 932 | $curve = &$path->curve; |
933 | 933 | $m = $curve->n; |
934 | 934 | $v = &$curve->vertex; |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | } |
941 | 941 | }; |
942 | 942 | |
943 | - $smooth = function (&$path) use ($mod, $interval, $ddenom, $dpara, $info) { |
|
943 | + $smooth = function(&$path) use ($mod, $interval, $ddenom, $dpara, $info) { |
|
944 | 944 | $m = $path->curve->n; |
945 | 945 | $curve = &$path->curve; |
946 | 946 | |
@@ -983,8 +983,8 @@ discard block |
||
983 | 983 | $curve->alphaCurve = 1; |
984 | 984 | }; |
985 | 985 | |
986 | - $optiCurve = function (&$path) use ($mod, $ddist, $sign, $cprod, $dpara, $interval, $tangent, $bezier, $iprod, $iprod1, $info) { |
|
987 | - $opti_penalty = function ($path, $i, $j, $res, $opttolerance, $convc, $areac) use ($mod, $ddist, $sign, $cprod, $dpara, $interval, $tangent, $bezier, $iprod, $iprod1) { |
|
986 | + $optiCurve = function(&$path) use ($mod, $ddist, $sign, $cprod, $dpara, $interval, $tangent, $bezier, $iprod, $iprod1, $info) { |
|
987 | + $opti_penalty = function($path, $i, $j, $res, $opttolerance, $convc, $areac) use ($mod, $ddist, $sign, $cprod, $dpara, $interval, $tangent, $bezier, $iprod, $iprod1) { |
|
988 | 988 | $m = $path->curve->n; |
989 | 989 | $curve = $path->curve; |
990 | 990 | $vertex = $curve->vertex; |
@@ -1250,31 +1250,31 @@ discard block |
||
1250 | 1250 | { |
1251 | 1251 | $bm = &$this->bm; |
1252 | 1252 | $pathlist = &$this->pathlist; |
1253 | - $path = function ($curve) use ($size) { |
|
1253 | + $path = function($curve) use ($size) { |
|
1254 | 1254 | |
1255 | - $bezier = function ($i) use ($curve, $size) { |
|
1256 | - $b = 'C ' . number_format($curve->c[$i * 3 + 0]->x * $size, 3) . ' ' . |
|
1257 | - number_format($curve->c[$i * 3 + 0]->y * $size, 3) . ','; |
|
1258 | - $b .= number_format($curve->c[$i * 3 + 1]->x * $size, 3) . ' ' . |
|
1259 | - number_format($curve->c[$i * 3 + 1]->y * $size, 3) . ','; |
|
1260 | - $b .= number_format($curve->c[$i * 3 + 2]->x * $size, 3) . ' ' . |
|
1261 | - number_format($curve->c[$i * 3 + 2]->y * $size, 3) . ' '; |
|
1255 | + $bezier = function($i) use ($curve, $size) { |
|
1256 | + $b = 'C '.number_format($curve->c[$i * 3 + 0]->x * $size, 3).' '. |
|
1257 | + number_format($curve->c[$i * 3 + 0]->y * $size, 3).','; |
|
1258 | + $b .= number_format($curve->c[$i * 3 + 1]->x * $size, 3).' '. |
|
1259 | + number_format($curve->c[$i * 3 + 1]->y * $size, 3).','; |
|
1260 | + $b .= number_format($curve->c[$i * 3 + 2]->x * $size, 3).' '. |
|
1261 | + number_format($curve->c[$i * 3 + 2]->y * $size, 3).' '; |
|
1262 | 1262 | |
1263 | 1263 | return $b; |
1264 | 1264 | }; |
1265 | 1265 | |
1266 | - $segment = function ($i) use ($curve, $size) { |
|
1267 | - $s = 'L ' . number_format($curve->c[$i * 3 + 1]->x * $size, 3) . ' ' . |
|
1268 | - number_format($curve->c[$i * 3 + 1]->y * $size, 3) . ' '; |
|
1269 | - $s .= number_format($curve->c[$i * 3 + 2]->x * $size, 3) . ' ' . |
|
1270 | - number_format($curve->c[$i * 3 + 2]->y * $size, 3) . ' '; |
|
1266 | + $segment = function($i) use ($curve, $size) { |
|
1267 | + $s = 'L '.number_format($curve->c[$i * 3 + 1]->x * $size, 3).' '. |
|
1268 | + number_format($curve->c[$i * 3 + 1]->y * $size, 3).' '; |
|
1269 | + $s .= number_format($curve->c[$i * 3 + 2]->x * $size, 3).' '. |
|
1270 | + number_format($curve->c[$i * 3 + 2]->y * $size, 3).' '; |
|
1271 | 1271 | |
1272 | 1272 | return $s; |
1273 | 1273 | }; |
1274 | 1274 | |
1275 | 1275 | $n = $curve->n; |
1276 | - $p = 'M' . number_format($curve->c[($n - 1) * 3 + 2]->x * $size, 3) . |
|
1277 | - ' ' . number_format($curve->c[($n - 1) * 3 + 2]->y * $size, 3) . ' '; |
|
1276 | + $p = 'M'.number_format($curve->c[($n - 1) * 3 + 2]->x * $size, 3). |
|
1277 | + ' '.number_format($curve->c[($n - 1) * 3 + 2]->y * $size, 3).' '; |
|
1278 | 1278 | |
1279 | 1279 | for ($i = 0; $i < $n; $i++) { |
1280 | 1280 | if ($curve->tag[$i] === "CURVE") { |
@@ -1293,9 +1293,9 @@ discard block |
||
1293 | 1293 | $len = count($pathlist); |
1294 | 1294 | |
1295 | 1295 | $svg = '<svg id="svg" version="1.1"' |
1296 | - . ' width="' . $w . '"' |
|
1297 | - . ' height="' . $h . '"' |
|
1298 | - . ' style="background-color: ' .$bgColor . '"' |
|
1296 | + . ' width="'.$w.'"' |
|
1297 | + . ' height="'.$h.'"' |
|
1298 | + . ' style="background-color: '.$bgColor.'"' |
|
1299 | 1299 | . ' xmlns="http://www.w3.org/2000/svg">'; |
1300 | 1300 | $svg .= '<path d="'; |
1301 | 1301 | for ($i = 0; $i < $len; $i++) { |
@@ -1311,7 +1311,7 @@ discard block |
||
1311 | 1311 | $fillc = $fgColor; |
1312 | 1312 | $fillrule = ' fill-rule="evenodd"'; |
1313 | 1313 | } |
1314 | - $svg .= '" stroke="' . $strokec . '" fill="' . $fillc . '"' . $fillrule . '/></svg>'; |
|
1314 | + $svg .= '" stroke="'.$strokec.'" fill="'.$fillc.'"'.$fillrule.'/></svg>'; |
|
1315 | 1315 | |
1316 | 1316 | return $svg; |
1317 | 1317 | } |