{"id":328279,"date":"2022-01-19T15:02:15","date_gmt":"2022-01-19T15:02:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=328279"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=328279","title":{"rendered":"<span>\u041f\u0438\u0448\u0435\u043c javascript \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f wysiwyg \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 Collage_n<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f &#8212;\u00a0<a href=\"https:\/\/github.com\/ivanChes2\/collagen_modules\" rel=\"noopener noreferrer nofollow\">paintSprites<\/a>\u00a0\u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u00a0<a href=\"https:\/\/github.com\/SergeyOvechkin\/collage_n\/\" rel=\"noopener noreferrer nofollow\">Colllage_n<\/a>\u00a0\u0438 \u0437\u0430 \u043e\u0434\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435\u00a0<a href=\"https:\/\/github.com\/SergeyOvechkin\/htmlix\" rel=\"noopener noreferrer nofollow\">Htmlix<\/a>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0438\u0441\u0442\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0430\u043a\u043e\u0433\u043e \u043b\u0438\u0431\u043e \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0435\u044e \u043a\u0430\u043a \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 paint. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u043e\u0439 \u043d\u0435 \u0431\u0443\u0434\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u0435 \u0441\u043f\u0440\u0430\u0439\u0442 \u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0438\u043c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043a\u0430\u0440\u0430\u043d\u0434\u0430\u0448\u043e\u043c \u0438\u043b\u0438 \u043a\u0438\u0441\u0442\u044c\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0443\u0437\u043e\u0440 \u043a\u0438\u0441\u0442\u0438 \u043f\u043e \u043e\u0441\u0438 \u0438\u043b\u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u043a\u043e\u043b\u0435\u0441\u0438\u043a\u043e\u043c \u043c\u044b\u0448\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u0446\u0432\u0435\u0442\u043e\u043a \u0438\u0437 \u043a\u0430\u043a\u043e\u0433\u043e \u043b\u0438\u0431\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c.  <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"748\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bec\/53f\/90d\/bec53f90da6c72b1ee59f38c07f83c91.png\" data-width=\"935\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u043d\u043b\u0430\u0439\u043d, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c <code>node.js<\/code> \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430, \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0443\u043b\u044f <code>paintSprites.js<\/code> \u0432 \u043f\u0430\u043f\u043a\u0443 modules, \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u0437 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c<strong>\u00a0node app<\/strong>\u00a0\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <code>http:\/\/localhost:3000\/<\/code>. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435\u00a0<strong>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c,<\/strong>\u00a0\u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0432 \u0430\u0434\u0440\u0435\u0441 \u043c\u043e\u0434\u0443\u043b\u044f\u00a0<strong>&#171;.\/js\/modules\/paintSprites.js&#187;<\/strong>\u00a0\u0438 \u043d\u0430\u0436\u0430\u0432 \u043a\u043d\u043e\u043f\u043a\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c. \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c.  <\/p>\n<h3>\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>Collage_n \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 htmlix \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430. \u0412 \u0444\u0430\u0439\u043b\u0435 <code>interface.js<\/code> \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u0431\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0430\u0439\u043b\u0430).  <\/p>\n<pre><code class=\"javascript\">[\"emiter-create-sprite\"] : {prop: \"\"}, \/\/\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u0430 [\"emiter-mousemove-canvas\"] : {prop: [\"x\", \"y\"]}, \/\/\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u043f\u043e \u043a\u0430\u043d\u0432\u0430\u0441 \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u0442\u043e\u0447\u043a\u0438  [\"emiter-mousedown-canvas\"] : {prop:  [\"x\", \"y\"]}, \/\/\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043a\u043b\u0438\u043a\u0430 \u043f\u043e \u043a\u0430\u043d\u0432\u0430\u0441 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 [\"emiter-mouseup-canvas\"] : {prop:  [\"x\", \"y\"]},  \/\/\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043a\u043b\u0438\u043a\u0430 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 [\"emiter-operation-with\"] : { \/\/\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0441\u043c\u0435\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e operationWith \u043d\u043d\u0443\u044e prop: \"common\", behavior: function(){ this.$props().operationWith = this.prop; } },<\/code><\/pre>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0443\u0436\u043d\u044b \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u0432\u0441\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u044b \u043e \u043a\u0430\u043a\u043e\u043c \u043b\u0438\u0431\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0438\u0437 \u043b\u044e\u0431\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <code>this.$$(\"emiter-\u0438\u043c\u044f-\u0441\u043e\u0431\u044b\u0442\u0438\u044f\").set(\"\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432\")<\/code> <\/p>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 canvas \u0438\u043c\u0435\u0435\u0442 \u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439: mousedown, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043b\u0438\u043a\u0430 \u043f\u043e \u043a\u0430\u043d\u0432\u0430\u0441 \u0434\u043b\u044f \u0444\u043e\u043d\u043e\u0432\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 <code>if(this.$props(\"operationWith\") == \"common\")<\/code> \u043b\u0438\u0431\u043e \u0434\u043b\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u0430 <code>if(this.$props().sprites[this.props(\"operationWith\")])<\/code> \u0434\u0432\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 mousemove \u0438 mouseup \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432 \u043d\u0438\u0445 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &#171;operationWith&#187; \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043e \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u043c \u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0435\u0433\u043e <code>id<\/code>.  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b: <strong>sprites.js<\/strong> &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432 <code>CollageSprite<\/code> \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435, \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c sprites \u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 <code>CollageSprite<\/code> \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 <code>$props().sprites<\/code> \u0447\u0435\u0440\u0435\u0437 id, <strong>draw_functions.js<\/strong> &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 canvas: \u043f\u043e\u043f\u0438\u043a\u0441\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0442.\u0434.  <\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f<\/h3>\n<p> \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043c\u043e\u0434\u0443\u043b\u044f: \u043a\u043d\u043e\u043f\u043a\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0434\u0432\u0430 \u043f\u043e\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0446\u0432\u0435\u0442\u0430 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c.<\/p>\n<pre><code class=\"javascript\">\/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c  \/\/onloadModules - \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 main.js (function(){    if(onloadModules.paintSprites  != undefined)return;    var html = `   &lt;div data-paint_sprites_panel=\"container\"  class=\"form-group\" name=\"paint_sprites_panel\"> &lt;label for=\"exampleFormControlInput1\" style=\"font-size: 15px; color: red; font-weight: bold;\">\u0420\u0438\u0441\u043e\u0432\u0430\u0442\u044c&lt;\/label> &lt;div class=\"form-row\">   &lt;div class=\"form-group col-md-4\"> &lt;button type=\"button\"  style=\"\" name=\"paint_btn\" class=\"btn btn-danger btn-sm\" title=\"\u0414\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043f\u0440\u0430\u0439\u0442 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0430\u0436\u0430\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438\">paint&lt;\/button> &lt;\/div>    &lt;div class=\"form-group col-md-4\">     &lt;input name=\"draw_sircle_radius\" type=\"text\" class=\"form-control form-control-sm\"  placeholder=\"\u0440\u0430\u0434\u0438\u0443\u0441\" title=\"\" value=\"5\"> &lt;\/div> &lt;div class=\"form-group col-md-4\"> &lt;input name=\"draw_sircle_color\" type=\"text\" class=\"form-control form-control-sm\"  placeholder=\"\u0446\u0432\u0435\u0442\" title=\"\" value=\"red\"> &lt;\/div>                  &lt;\/div>    &lt;\/div> `;    \/\/\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043e\u0431\u0449\u044e\u044e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 javascript \u0432 \u043b\u044e\u0431\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \/\/\u0441\u043e\u0437\u0434\u0430\u043b\u0438 div \u043d\u0430\u0448\u043b\u0438 \u043a\u0443\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \"[data-main-form]\" \u0438 \u0438 \u043f\u0435\u0440\u0435\u0434 \u043a\u0435\u043c \"[name='common_btn_class']\"   var div = document.createElement(\"div\");   div.innerHTML = html;   div = div.querySelector(\"div\");   var parent = document.querySelector(\"[data-main_form]\");   var insert_before = document.querySelector(\"[name='common_btns_class']\")   var insertedElement = parent.insertBefore(div, insert_before);      \/\/\u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f     var paint_sprites_panel = {      container: \"paint_sprites_panel\",      props: [ ],      methods: {}    } \/\/\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.   HM.description.paint_sprites_panel  = paint_sprites_panel; \/\/\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c     HM.containerInit(div , HM.description, \"paint_sprites_panel\"); HM.eventProps[\"emiter-operation-with\"].emit(); \/\/\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u044b\u043c (\u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430) \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439 canvas \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \/\/\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0444\u043b\u0430\u0433 \u0434\u043b\u044f \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f onloadModules.paintSprites  = true; })()<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432 \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043b \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u043b\u0438\u043a\u0430 \u043f\u043e \u043a\u0430\u043d\u0432\u0430\u0441 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u043e \u043d\u0435\u043c\u0443 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 &#8212; \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441\u043c\u0435\u043d\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <code>operation_with<\/code> \u0438 \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u0430\u043a\u0442\u0438\u0432\u0435\u043d <code>!= paint-sprites<\/code>, \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438.  <\/p>\n<pre><code class=\"javascript\">  props: [          [\"canvas_click\", \"emiter-mousedown-canvas\", \"\"],     [\"canvas_move\", \"emiter-mousemove-canvas\", \"\"],     [\"mouse_up\", \"emiter-mouseup-canvas\", \"\"],          \/\/\u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043c\u044b \u0438\u0445 \u0431\u0443\u0434\u0435\u043c \u0432 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f      [\"operation_with\", \"emiter-operation-with\", \"\"], ] methods: {   operation_with: function(){ \/\/\u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439 canvas \u0441\u043e\u0431\u044b\u0442\u0438\u0439 ( mousedown) \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u0441\u0441\u0438\u0432\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438     if(this.emiter.prop != \"paint-sprites\" ){      this.parent.props.canvas_click.disableEvent();\/\/ \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f         this.parent.props.canvas_move.disableEvent();         this.parent.props.mouse_up.disableEvent();   }else{   this.parent.props.canvas_click.enableEvent();         this.parent.props.canvas_move.enableEvent();         this.parent.props.mouse_ap.enableEvent();   }                } }  <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043d\u043e\u043f\u043a\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c<\/p>\n<pre><code class=\"javascript\">props: [            [\"paint_btn\", \"click\", \"[name='paint_btn']\"], \/\/\u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u043f\u043e \u0435\u0435 \u0438\u043c\u0435\u043d\u0438 (\u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f)    paint_btn: function(){ \/\/\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043b\u0438\u043a\u0443 \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435         \/\/\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438(\u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f) \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043a\u0430\u043d\u0432\u0430\u0441 \u0438 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\u0441\u043a\u0440\u044b\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0442.\u0434.)\u0438\u044f \u043e   this.$$(\"emiter-operation-with\").set(\"paint-sprites\");        }, <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043c\u044b\u0448\u0438, \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0438 \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043c\u044b\u0448\u0438, \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0443 \u043d\u0430\u0441 \u0438\u0437 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043c\u044b \u0438\u0445 \u0443\u0436\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a \u043d\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u044b, \u0442\u0430\u043a\u0436\u0435 \u0435\u0449\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0446\u0432\u0435\u0442\u0430 \u043a\u0438\u0441\u0442\u0438.  <\/p>\n<pre><code class=\"javascript\">props:[   \/\/\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0434\u0432\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0446\u0432\u0435\u0442\u0430 \u043a\u0438\u0441\u0442\u0438   \/\/...........................    [\"draw_sircle_radius\", \"inputvalue\", \"[name='draw_sircle_radius']\"],     [\"draw_sircle_color\", \"inputvalue\", \"[name='draw_sircle_color']\"], ]  canvas_click: function(){\/\/\u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438      \/\/\u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0444\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c functions.js   saveStep(saveImg, this.$props().commonProps.area_1); ctx.save();       ctx.putImageData(saveImg, 0, 0); \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/         \/\/\u0440\u0438\u0441\u0443\u0435\u043c \u043a\u0440\u0443\u0433 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0440\u0435\u043c \u0438\u0437 \u0444\u043e\u0440\u043c\u044b \u0432\u0432\u043e\u0434\u0430 \u0446\u0432\u0435\u0442\u0430 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430         \/\/this.emiter.prop \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f- \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043a\u043b\u0438\u043a\u0430 \u043f\u043e x \u0438 \u0443 \u043e\u0441\u044f\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 ctx.beginPath(); ctx.arc(this.emiter.prop[0], this.emiter.prop[1], this.parent.props.draw_sircle_radius.getProp(), 0, 2*Math.PI, false); ctx.fillStyle =  this.parent.props.draw_sircle_color.getProp(); ctx.fill(); ctx.lineWidth = 0.1; ctx.strokeStyle =  this.parent.props.draw_sircle_color.getProp(); ctx.stroke();         \/\/\/\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0438\u0436\u0435 \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u0440\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438\u0437 \u0444\u043e\u0440\u043c\u044b \u0432\u0432\u043e\u0434\u0430 \u043f\u0440\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u0430        this.parent.props.canvas_move.prop  =  { color:  this.parent.props.draw_sircle_color.getProp(), radius:  this.parent.props.draw_sircle_radius.getProp(),    }       },     canvas_move: function(){ \/\/\u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0438 \u043f\u0440\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u043c\u044b\u0448\u0438       if(this.prop != null){ \/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441 \u043a\u043e\u0433\u0434\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 \u043f\u043e\u0434\u043d\u044f\u0442\u0430   ctx.beginPath();   ctx.arc(this.emiter.prop[0], this.emiter.prop[1], this.prop.radius, 0, 2*Math.PI, false);   ctx.fillStyle =  this.prop.color;   ctx.fill();   ctx.lineWidth = 0.1;   ctx.strokeStyle =  this.prop.color;   ctx.stroke();       }   }, mouse_up: function(){                 \/\/\u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0442\u043c\u0435\u043d\u044b \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f                    this.parent.props.canvas_move.prop = null; \/\/\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e saveImage \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u0435\u0440\u0445\u0443 \u0441\u043f\u0440\u0430\u0439\u0442\u044b, \u043a\u043e\u043d\u0442\u0443\u0440 \u0438 \u0442.\u0434.                 \/\/\u0414\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0444\u043e\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0438\u0437 \u043d\u0435\u0435 (main.js) saveImg = ctx.getImageData(0,0, srcWidth, srcHeight); ctx.restore();    },  <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0433\u043e\u0442\u043e\u0432 \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043a\u0430\u0440\u0430\u043d\u0434\u0430\u0448\u0435\u043c, \u0446\u0432\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u043c\u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438 <code>\"rgba(32, 45, 21, 0.3)\", red,  #6610f2<\/code> \u0438 \u0442.\u0434. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/646457\/\"> https:\/\/habr.com\/ru\/post\/646457\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f &#8212;\u00a0<a href=\"https:\/\/github.com\/ivanChes2\/collagen_modules\" rel=\"noopener noreferrer nofollow\">paintSprites<\/a>\u00a0\u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u00a0<a href=\"https:\/\/github.com\/SergeyOvechkin\/collage_n\/\" rel=\"noopener noreferrer nofollow\">Colllage_n<\/a>\u00a0\u0438 \u0437\u0430 \u043e\u0434\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435\u00a0<a href=\"https:\/\/github.com\/SergeyOvechkin\/htmlix\" rel=\"noopener noreferrer nofollow\">Htmlix<\/a>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0438\u0441\u0442\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0430\u043a\u043e\u0433\u043e \u043b\u0438\u0431\u043e \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0435\u044e \u043a\u0430\u043a \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 paint. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u043e\u0439 \u043d\u0435 \u0431\u0443\u0434\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u0435 \u0441\u043f\u0440\u0430\u0439\u0442 \u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0438\u043c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043a\u0430\u0440\u0430\u043d\u0434\u0430\u0448\u043e\u043c \u0438\u043b\u0438 \u043a\u0438\u0441\u0442\u044c\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0443\u0437\u043e\u0440 \u043a\u0438\u0441\u0442\u0438 \u043f\u043e \u043e\u0441\u0438 \u0438\u043b\u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u043a\u043e\u043b\u0435\u0441\u0438\u043a\u043e\u043c \u043c\u044b\u0448\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u0446\u0432\u0435\u0442\u043e\u043a \u0438\u0437 \u043a\u0430\u043a\u043e\u0433\u043e \u043b\u0438\u0431\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c.  <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u043d\u043b\u0430\u0439\u043d, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c <code>node.js<\/code> \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430, \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0443\u043b\u044f <code>paintSprites.js<\/code> \u0432 \u043f\u0430\u043f\u043a\u0443 modules, \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u0437 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c<strong>\u00a0node app<\/strong>\u00a0\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <code>http:\/\/localhost:3000\/<\/code>. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435\u00a0<strong>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c,<\/strong>\u00a0\u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0432 \u0430\u0434\u0440\u0435\u0441 \u043c\u043e\u0434\u0443\u043b\u044f\u00a0<strong>&#171;.\/js\/modules\/paintSprites.js&#187;<\/strong>\u00a0\u0438 \u043d\u0430\u0436\u0430\u0432 \u043a\u043d\u043e\u043f\u043a\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c. \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c.  <\/p>\n<h3>\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>Collage_n \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 htmlix \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430. \u0412 \u0444\u0430\u0439\u043b\u0435 <code>interface.js<\/code> \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u0431\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0430\u0439\u043b\u0430).  <\/p>\n<pre><code class=\"javascript\">[\"emiter-create-sprite\"] : {prop: \"\"}, \/\/\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u0430 [\"emiter-mousemove-canvas\"] : {prop: [\"x\", \"y\"]}, \/\/\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u043f\u043e \u043a\u0430\u043d\u0432\u0430\u0441 \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u0442\u043e\u0447\u043a\u0438  [\"emiter-mousedown-canvas\"] : {prop:  [\"x\", \"y\"]}, \/\/\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043a\u043b\u0438\u043a\u0430 \u043f\u043e \u043a\u0430\u043d\u0432\u0430\u0441 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 [\"emiter-mouseup-canvas\"] : {prop:  [\"x\", \"y\"]},  \/\/\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043a\u043b\u0438\u043a\u0430 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 [\"emiter-operation-with\"] : { \/\/\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0441\u043c\u0435\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e operationWith \u043d\u043d\u0443\u044e prop: \"common\", behavior: function(){ this.$props().operationWith = this.prop; } },<\/code><\/pre>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0443\u0436\u043d\u044b \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u0432\u0441\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u044b \u043e \u043a\u0430\u043a\u043e\u043c \u043b\u0438\u0431\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0438\u0437 \u043b\u044e\u0431\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <code>this.$$(\"emiter-\u0438\u043c\u044f-\u0441\u043e\u0431\u044b\u0442\u0438\u044f\").set(\"\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432\")<\/code> <\/p>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 canvas \u0438\u043c\u0435\u0435\u0442 \u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439: mousedown, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043b\u0438\u043a\u0430 \u043f\u043e \u043a\u0430\u043d\u0432\u0430\u0441 \u0434\u043b\u044f \u0444\u043e\u043d\u043e\u0432\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 <code>if(this.$props(\"operationWith\") == \"common\")<\/code> \u043b\u0438\u0431\u043e \u0434\u043b\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u0430 <code>if(this.$props().sprites[this.props(\"operationWith\")])<\/code> \u0434\u0432\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 mousemove \u0438 mouseup \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432 \u043d\u0438\u0445 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &#171;operationWith&#187; \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043e \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u043c \u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0435\u0433\u043e <code>id<\/code>.  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b: <strong>sprites.js<\/strong> &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432 <code>CollageSprite<\/code> \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435, \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c sprites \u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 <code>CollageSprite<\/code> \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 <code>$props().sprites<\/code> \u0447\u0435\u0440\u0435\u0437 id, <strong>draw_functions.js<\/strong> &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 canvas: \u043f\u043e\u043f\u0438\u043a\u0441\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0442.\u0434.  <\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f<\/h3>\n<p> \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043c\u043e\u0434\u0443\u043b\u044f: \u043a\u043d\u043e\u043f\u043a\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0434\u0432\u0430 \u043f\u043e\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0446\u0432\u0435\u0442\u0430 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c.<\/p>\n<pre><code class=\"javascript\">\/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c  \/\/onloadModules - \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 main.js (function(){    if(onloadModules.paintSprites  != undefined)return;    var html = `   &lt;div data-paint_sprites_panel=\"container\"  class=\"form-group\" name=\"paint_sprites_panel\"> &lt;label for=\"exampleFormControlInput1\" style=\"font-size: 15px; color: red; font-weight: bold;\">\u0420\u0438\u0441\u043e\u0432\u0430\u0442\u044c&lt;\/label> &lt;div class=\"form-row\">   &lt;div class=\"form-group col-md-4\"> &lt;button type=\"button\"  style=\"\" name=\"paint_btn\" class=\"btn btn-danger btn-sm\" title=\"\u0414\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043f\u0440\u0430\u0439\u0442 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0430\u0436\u0430\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438\">paint&lt;\/button> &lt;\/div>    &lt;div class=\"form-group col-md-4\">     &lt;input name=\"draw_sircle_radius\" type=\"text\" class=\"form-control form-control-sm\"  placeholder=\"\u0440\u0430\u0434\u0438\u0443\u0441\" title=\"\" value=\"5\"> &lt;\/div> &lt;div class=\"form-group col-md-4\"> &lt;input name=\"draw_sircle_color\" type=\"text\" class=\"form-control form-control-sm\"  placeholder=\"\u0446\u0432\u0435\u0442\" title=\"\" value=\"red\"> &lt;\/div>                  &lt;\/div>    &lt;\/div> `;    \/\/\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043e\u0431\u0449\u044e\u044e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 javascript \u0432 \u043b\u044e\u0431\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \/\/\u0441\u043e\u0437\u0434\u0430\u043b\u0438 div \u043d\u0430\u0448\u043b\u0438 \u043a\u0443\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \"[data-main-form]\" \u0438 \u0438 \u043f\u0435\u0440\u0435\u0434 \u043a\u0435\u043c \"[name='common_btn_class']\"   var div = document.createElement(\"div\");   div.innerHTML = html;   div = div.querySelector(\"div\");   var parent = document.querySelector(\"[data-main_form]\");   var insert_before = document.querySelector(\"[name='common_btns_class']\")   var insertedElement = parent.insertBefore(div, insert_before);      \/\/\u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f     var paint_sprites_panel = {      container: \"paint_sprites_panel\",      props: [ ],      methods: {}    } \/\/\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.   HM.description.paint_sprites_panel  = paint_sprites_panel; \/\/\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c     HM.containerInit(div , HM.description, \"paint_sprites_panel\"); HM.eventProps[\"emiter-operation-with\"].emit(); \/\/\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u044b\u043c (\u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430) \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439 canvas \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \/\/\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0444\u043b\u0430\u0433 \u0434\u043b\u044f \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f onloadModules.paintSprites  = true; })()<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432 \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043b \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u043b\u0438\u043a\u0430 \u043f\u043e \u043a\u0430\u043d\u0432\u0430\u0441 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u043e \u043d\u0435\u043c\u0443 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 &#8212; \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441\u043c\u0435\u043d\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <code>operation_with<\/code> \u0438 \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u0430\u043a\u0442\u0438\u0432\u0435\u043d <code>!= paint-sprites<\/code>, \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438.  <\/p>\n<pre><code class=\"javascript\">  props: [          [\"canvas_click\", \"emiter-mousedown-canvas\", \"\"],     [\"canvas_move\", \"emiter-mousemove-canvas\", \"\"],     [\"mouse_up\", \"emiter-mouseup-canvas\", \"\"],          \/\/\u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043c\u044b \u0438\u0445 \u0431\u0443\u0434\u0435\u043c \u0432 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f      [\"operation_with\", \"emiter-operation-with\", \"\"], ] methods: {   operation_with: function(){ \/\/\u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439 canvas \u0441\u043e\u0431\u044b\u0442\u0438\u0439 ( mousedown) \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u0441\u0441\u0438\u0432\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438     if(this.emiter.prop != \"paint-sprites\" ){      this.parent.props.canvas_click.disableEvent();\/\/ \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f         this.parent.props.canvas_move.disableEvent();         this.parent.props.mouse_up.disableEvent();   }else{   this.parent.props.canvas_click.enableEvent();         this.parent.props.canvas_move.enableEvent();         this.parent.props.mouse_ap.enableEvent();   }                } }  <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043d\u043e\u043f\u043a\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c<\/p>\n<pre><code class=\"javascript\">props: [            [\"paint_btn\", \"click\", \"[name='paint_btn']\"], \/\/\u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u043f\u043e \u0435\u0435 \u0438\u043c\u0435\u043d\u0438 (\u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f)    paint_btn: function(){ \/\/\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043b\u0438\u043a\u0443 \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435         \/\/\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438(\u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f) \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043a\u0430\u043d\u0432\u0430\u0441 \u0438 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\u0441\u043a\u0440\u044b\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0442.\u0434.)\u0438\u044f \u043e   this.$$(\"emiter-operation-with\").set(\"paint-sprites\");        }, <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043c\u044b\u0448\u0438, \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0438 \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043c\u044b\u0448\u0438, \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0443 \u043d\u0430\u0441 \u0438\u0437 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043c\u044b \u0438\u0445 \u0443\u0436\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a \u043d\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u044b, \u0442\u0430\u043a\u0436\u0435 \u0435\u0449\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0446\u0432\u0435\u0442\u0430 \u043a\u0438\u0441\u0442\u0438.  <\/p>\n<pre><code class=\"javascript\">props:[   \/\/\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0434\u0432\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0446\u0432\u0435\u0442\u0430 \u043a\u0438\u0441\u0442\u0438   \/\/...........................    [\"draw_sircle_radius\", \"inputvalue\", \"[name='draw_sircle_radius']\"],     [\"draw_sircle_color\", \"inputvalue\", \"[name='draw_sircle_color']\"], ]  canvas_click: function(){\/\/\u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438      \/\/\u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0444\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c functions.js   saveStep(saveImg, this.$props().commonProps.area_1); ctx.save();       ctx.putImageData(saveImg, 0, 0); \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/         \/\/\u0440\u0438\u0441\u0443\u0435\u043c \u043a\u0440\u0443\u0433 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0440\u0435\u043c \u0438\u0437 \u0444\u043e\u0440\u043c\u044b \u0432\u0432\u043e\u0434\u0430 \u0446\u0432\u0435\u0442\u0430 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430         \/\/this.emiter.prop \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f- \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043a\u043b\u0438\u043a\u0430 \u043f\u043e x \u0438 \u0443 \u043e\u0441\u044f\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 ctx.beginPath(); ctx.arc(this.emiter.prop[0], this.emiter.prop[1], this.parent.props.draw_sircle_radius.getProp(), 0, 2*Math.PI, false); ctx.fillStyle =  this.parent.props.draw_sircle_color.getProp(); ctx.fill(); ctx.lineWidth = 0.1; ctx.strokeStyle =  this.parent.props.draw_sircle_color.getProp(); ctx.stroke();         \/\/\/\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0438\u0436\u0435 \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u0440\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438\u0437 \u0444\u043e\u0440\u043c\u044b \u0432\u0432\u043e\u0434\u0430 \u043f\u0440\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u0430        this.parent.props.canvas_move.prop  =  { color:  this.parent.props.draw_sircle_color.getProp(), radius:  this.parent.props.draw_sircle_radius.getProp(),    }       },     canvas_move: function(){ \/\/\u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0438 \u043f\u0440\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u043c\u044b\u0448\u0438       if(this.prop != null){ \/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441 \u043a\u043e\u0433\u0434\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 \u043f\u043e\u0434\u043d\u044f\u0442\u0430   ctx.beginPath();   ctx.arc(this.emiter.prop[0], this.emiter.prop[1], this.prop.radius, 0, 2*Math.PI, false);   ctx.fillStyle =  this.prop.color;   ctx.fill();   ctx.lineWidth = 0.1;   ctx.strokeStyle =  this.prop.color;   ctx.stroke();       }   }, mouse_up: function(){                 \/\/\u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0442\u043c\u0435\u043d\u044b \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f                    this.parent.props.canvas_move.prop = null; \/\/\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e saveImage \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u0435\u0440\u0445\u0443 \u0441\u043f\u0440\u0430\u0439\u0442\u044b, \u043a\u043e\u043d\u0442\u0443\u0440 \u0438 \u0442.\u0434.                 \/\/\u0414\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0444\u043e\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0438\u0437 \u043d\u0435\u0435 (main.js) saveImg = ctx.getImageData(0,0, srcWidth, srcHeight); ctx.restore();    },  <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0433\u043e\u0442\u043e\u0432 \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043a\u0430\u0440\u0430\u043d\u0434\u0430\u0448\u0435\u043c, \u0446\u0432\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u043c\u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438 <code>\"rgba(32, 45, 21, 0.3)\", red,  #6610f2<\/code> \u0438 \u0442.\u0434. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/646457\/\"> https:\/\/habr.com\/ru\/post\/646457\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-328279","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=328279"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328279\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=328279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=328279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=328279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}