日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

fabricjs 高级篇(自定义类型)

發布時間:2025/3/14 编程问答 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 fabricjs 高级篇(自定义类型) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

原文:?https://www.sitepoint.com/fabric-js-advanced/

<html> <head><script src='./js/fabric.min.js'></script> </head> <body><canvas id="c" style="border:1px solid red;"></canvas> <script> var canvas = new fabric.Canvas('c',{backgroundColor : "#0ff",width: '600',height: '600'}); var LabeledRect = fabric.util.createClass(fabric.Rect, {type: 'labeledRect',initialize: function(options) {options || (options = { });this.callSuper('initialize', options);this.set('label', options.label || '');this.set('labelFont', options.labelFont || '');this.set('labelFill', options.labelFill || '');},toObject: function() {return fabric.util.object.extend(this.callSuper('toObject'), {label: this.get('label'),labelFont: this.get('labelFont'),labelFill: this.get('labelFill')});},_render: function(ctx) {this.callSuper('_render', ctx);// ctx.font = '20px Helvetica';// ctx.fillStyle = '#333';console.log('this', this);ctx.font = this.labelFont;ctx.fillStyle = this.labelFill;// ctx.fillText(this.label, -this.width/2, -this.height/2 + 20);ctx.fillText(this.label, 0, 0+10);}});var labeledRect = new LabeledRect({width: 100,height: 50,left: 100,top: 100,label: 'test',fill: '#faa',labelFont: '30px Helvetica',labelFill: '#00ff00'});canvas.add(labeledRect);setTimeout(function(){labeledRect.set({label: 'trololo',fill: '#aaf',rx: 10,ry: 10,labelFill: '#0000ff'});canvas.renderAll();}, 3000) </script> </body> </html>

  結果如下:

?

?

----------------------------------------

We’ve covered most of the basics of Fabric in the?first?and?second?parts of this series. In this article, I’ll move on to more advanced features: groups, serialization (and deserialization) and classes.

Groups

The first topic I’ll talk about is groups, one of Fabric’s most powerful features. Groups are exactly what they sound like—a simple way to group Fabric objects into a single entity so that you can work with those objects as a unit. (See?Figure 1.)


Figure 1. A Selection Becomes a Group in Fabric

Remember that any number of Fabric objects on the canvas can be grouped with the mouse to form a single selection. Once grouped, the objects can be moved and even modified as one. You can scale the group, rotate it, and even change its presentational properties—its color, transparency, borders, and so on.

Every time you select objects like this on the canvas, Fabric creates a group implicitly, behind the scenes. Given this, it only makes sense to provide access to groups programmatically, which is where?fabric.Group?comes in.

Let’s create a group from two objects, a circle and text:

var text = new fabric.Text('hello world', {fontSize: 30});var circle = new fabric.Circle({radius: 100,fill: '#eef',scaleY: 0.5});var group = new fabric.Group([ text, circle ], {left: 150,top: 100,angle: -10});canvas.add(group);

First, I created a “hello world” text object. Then, I created a circle with a 100 px radius, filled with the “#eef” color and squeezed vertically (scaleY=0.5). I next created a?fabric.Group?instance, passing it an array with these two objects and giving it a position of 150/100 at a -10 degree angle. Finally, I added the group to the canvas, as I would with any other object, by using?canvas.add().

Voila! You see an object on the canvas as shown in?Figure 2, a labeled ellipse, and can now work with this object as a single entity. To modify that object, you simply change properties of the group, here giving it custom left, top and angle values.


Figure 2.?A Group Created Programmatically

And now that we have a group on our canvas, let’s change it up a little:

group.item(0).set({text: 'trololo',fill: 'white'});group.item(1).setFill('red');

Here, we access individual objects in a group via the item method and modify their properties. The first object is the text, and the second is the squeezed circle.?Figure 3shows the results.


Figure 3. Squeezed Red Circle with New Text

One important idea you’ve probably noticed by now is that objects in a group are all positioned relative to the center of the group. When I changed the text property of the text object, it remained centered even when I changed its width. If you don’t want this behavior, you need to specify an object’s left/top coordinates, in which case they’ll be grouped according to those coordinates.

Here’s how to create and group three circles so that they’re positioned horizontally one after the other, such as those shown in?Figure 4.

var circle1 = new fabric.Circle({radius: 50,fill: 'red',left: 0});var circle2 = new fabric.Circle({radius: 50,fill: 'green',left: 100});var circle3 = new fabric.Circle({radius: 50,fill: 'blue',left: 200});var group = new fabric.Group([ circle1, circle2, circle3 ], {left: 200,top: 100});canvas.add(group);


Figure 4. A Group with Three Circles Aligned Horizontally

Another point to keep in mind when working with groups is the state of the objects. For example, when forming a group with images, you need to be sure those images are fully loaded. Since Fabric already provides helper methods for ensuring that an image is loaded, this operation becomes fairly easy, as you can see in this code and in Figure 5.

fabric.Image.fromURL('/assets/pug.jpg', function(img) {var img1 = img.scale(0.1).set({ left: 100, top: 100 });fabric.Image.fromURL('/assets/pug.jpg', function(img) {var img2 = img.scale(0.1).set({ left: 175, top: 175 });fabric.Image.fromURL('/assets/pug.jpg', function(img) {var img3 = img.scale(0.1).set({ left: 250, top: 250 });canvas.add(new fabric.Group([ img1, img2, img3],{ left: 200, top: 200 }))});});});


Figure 5. A Group with Three Images

Several other methods are available for working with groups:

  • getObjects works exactly like fabric.Canvas#getObjects() and returns an array of all objects in a group
  • size represents the number of objects in a group
  • contains allows you to check whether a particular object is in a group
  • item (which you saw earlier) allows you to retrieve a specific object from a group
  • forEachObject also mirrors fabric.Canvas#forEachObject, but in relation to group objects
  • add and remove add and remove objects from a group, respectively

You can add or remove objects with or without updating group dimensions and position. Here are several examples:

To add a rectangle at the center of a group (left=0, top=0), use this code:

group.add(new?fabric.Rect({...}));

To add a rectangle 100 px from the center of the group, do this:

group.add(new fabric.Rect({...left: 100,top: 100}));

To add a rectangle at the center of a group and update the group’s dimensions, use the following code:

group.addWithUpdate(new?fabric.Rect({...left:?group.getLeft(),top:?group.getTop()}));

To add a rectangle at 100 px off from the center of a group and update the group’s dimensions, do this:

group.addWithUpdate(new?fabric.Rect({...left:?group.getLeft()?+?100,top:?group.getTop()?+?100}));

Finally, if you want to create a group with objects that are already present on the canvas, you need to clone them first:

// create a group with copies of existing (2) objectsvar group = new fabric.Group([canvas.item(0).clone(),canvas.item(1).clone()]);// remove all objects and re-rendercanvas.clear().renderAll();// add group onto canvascanvas.add(group);

Serialization

As soon as you start building a stateful application of some sort—perhaps one that allows users to save results of canvas contents on a server or streaming contents to a different client—you need canvas serialization. There’s always an option to export the canvas to an image, but uploading a large image to a server requires a lot of bandwidth. Nothing beats text when it comes to size, and that’s exactly why Fabric provides an excellent support for canvas serialization and deserialization.

toObject, toJSON

The backbone of canvas serialization in Fabric are the?fabric.Canvas#toObjectand?fabric.Canvas#toJSON?methods. Let’s take a look at a simple example, first serializing an empty canvas:

var?canvas?=?new?fabric.Canvas('c');JSON.stringify(canvas);?//?'{"objects":[],"background":"rgba(0,?0,?0,?0)"}'

Here I’m using the ES5?JSON.stringify?method, which implicitly calls the toJSON method on the passed object if that method exists. Because a canvas instance in Fabric has a toJSON method, it’s as though we called?JSON.stringify(canvas.toJSON())?instead.

Notice the returned string that represents the empty canvas. It’s in JSON format, and essentially consists of “objects” and “background” properties. The “objects” property is currently empty because there’s nothing on the canvas, and “background” has a default transparent value (“rgba(0, 0, 0, 0)”).

Let’s give our canvas a different background and see how things change:

canvas.backgroundColor?=?'red';JSON.stringify(canvas);?//?'{"objects":[],"background":"red"}'

As you would expect, the canvas representation reflects the new background color. Now let’s add some objects:

canvas.add(new fabric.Rect({left: 50,top: 50,height: 20,width: 20,fill: 'green'}));console.log(JSON.stringify(canvas));

The logged output is as follows:

'{"objects":[{"type":"rect","left":50,"top":50,"width":20,"height":20,"fill":"green","overlayFill":null, "stroke":null,"strokeWidth":1,"strokeDashArray":null,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false, "opacity":1,"selectable":true,"hasControls":true,"hasBorders":true,"hasRotatingPoint":false,"transparentCorners":true, "perPixelTargetFind":false,"rx":0,"ry":0}],"background":"rgba(0, 0, 0, 0)"}'

Wow! At first sight, quite a lot has changed, but looking more closely, you can see that the newly added object is now part of the “objects” array, serialized into JSON. Notice how its representation includes all its visual traits—left, top, width, height, fill, stroke and so on.

If we were to add another object—say, a red circle positioned next to the rectangle—you would see that the representation changed accordingly:

canvas.add(new fabric.Circle({left: 100,top: 100,radius: 50,fill: 'red'}));console.log(JSON.stringify(canvas));

Here’s the logged output now:

'{"objects":[{"type":"rect","left":50,"top":50,"width":20,"height":20,"fill":"green","overlayFill":null, "stroke":null,"strokeWidth":1,"strokeDashArray":null,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false, "opacity":1,"selectable":true,"hasControls":true,"hasBorders":true,"hasRotatingPoint":false,"transparentCorners":true, "perPixelTargetFind":false,"rx":0,"ry":0},"type":"circle","left":100,"top":100,"width":100,"height":100,"fill":"red", "overlayFill":null,"stroke":null,"strokeWidth":1,"strokeDashArray":null,"scaleX":1,"scaleY":1,"angle":0,"flipX":false, "flipY":false,"opacity":1,"selectable":true,"hasControls":true,"hasBorders":true,"hasRotatingPoint":false, "transparentCorners":true,"perPixelTargetFind":false,"radius":50}],"background":"rgba(0, 0, 0, 0)"}'

Notice the “type”:”rect” and “type”:”circle” parts so that you can see better where those objects are. Even though it might seem like a lot of output at first, it is nothing compared to what you would get with image serialization. Just for fun, take a look at about one-tenth (!) of a string you would get with?canvas.toDataURL('png'):

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAK8CAYAAAAXo9vkAAAgAElEQVR4Xu3dP4xtBbnG4WPAQOQ2YBCLK1qpoQE1 /m+NVlCDwUACicRCEuysrOwkwcJgAglEItRQaWz9HxEaolSKtxCJ0FwMRIj32zqFcjm8e868s2fNWoJygl+e397rWetk5xf5pyZd13wPwIEC BAgQIAAAQIECBxI4F0H+hwfQ4AAAQIECBAgQIAAgQsCxENAgAABAgQIECBAgMDBBATIwah9EAECBAgQIECAAAECAsQzQIAAAQIECBAgQIDAw QQEyMGofRABAgQIECBAgAABAgLEM0CAAAECBAgQIECAwMEEBMjBqH0QAQIECBAgQIAAAQICxDNAgAABAgQIECBAgMDBBATIwah9EAECBAgQI ECAAAECAsQzQIAAAQIECBAgQIDAwQQEyMGofRABAgQIECBAgAABAgLEM0CAAAECBAgQIECAwMEEBMjBqH0QAQIECBAgQIAAAQICxDNAgAABA gQIECBAgMDBBATIwah9EAECBAgQIECAAAECAsQzQIAAAQIECBAgQIDAwQQEyMGofRABAgQIECBAgAABAgLEM0CAAAECBAgQIECAwMEEBMjBq H0QAQIECBAgQIAAAQICxDNAgAABAgQIECBAgMDBBATIwah9EAECBAgQIECAAAECAsQzQIAAAQIECBAgQIDAwQQEyMGofRABAgQIECBAgAABA gLEM0CAAAECBAgQIECAwMEEBMjBqH0QAQIECBAgQIAAAQICxDNAgAABAgQIECBAgMDBBATIwah9EAECBAgQIECAAAECAsQzQIAAAQIECBAgQ IDAwQQEyMGofRABAgQIECBAgAABAgLEM0CAAAECBAgQIECAwMEEBMjBqH0QAQIECBAgQIAAAQICxDNAgAABAgQIECBAgMDBBATIwah9EAECB AgQIECAAAECAsQzQIAAAQIECBAgQIDAwQQEyMGofRABAgQIECBAgAABAgLEM0CAAAECBAgQIECAwMEEBMjBqH0QAQIECBAgQIAAAQICxDNAg AABAgQIECBAgMDBBATIwah9EAECBAgQIECAAAECyw+Qb134RU2fevC8q+5esGWESBAgAABAgQIEFiOwPLMC5AlvO0OBMCBAgQIECAAAECJxQ QICcE9HYCBAgQIECAAAECBPYXECD7W3klAQIECBAgQIAAAQInFBAgJwT0dgIECBAgQIAAAQIE9hcQIPtbeSUBAgQIECBAgAABAicUECAnBPR 2AgQIECBAgAABAgT2FxAg+1t5JQECBAgQIECAAAECJxQQICcE9HYCBAgQIECAAAECBPYXECD7W3klAQIECBAgQIAAAQInFBAgJwTc9+3z49y vmNd+dI7PzPHJOW6Y4wNzXD3HlXNc9pZdb85/vzbHK3P8aY7n5vj1HL+Y43dz417f97O9jgABAgQIECBAgMBSBATIKd2JCY5dWNwyx5fn+Pw cV5U/6tXZ99M5fjjHk3Mjd6HifwQIECBAgAABAgQWLSBAirdnouP6WXfvHHfOcU1x9T6rXp4XPTLHA3NTX9jnDV5DgAABAgQIECBA4NACAuS E4hMdl8+Kr83xzTmuO+G61ttfnEXfnuN7c4PfaC21hwABAgQIECBAgMBJBQTIJQpOeFw7b71/jtsvccWh3vbYfNB9c6NfOtQH+hwCBAgQIEC AAAECFxMQIMd8No7C4+F5283HfOtZv/ypOYG7hMhZ3wafT4AAAQIECBDYtoAA2fP+H/1Vqwd3f4jf8y1Lfdkunu7xV7OWenucFwECBAgQIEB g3QICZI/7O/Fxx7xs9wf3t36r3D3evciX7L7F7+6rIY8u8uycFAECBAgQIE

…and there’s approximately 17,000 characters more.

You might be wondering why there’s also?fabric.Canvas#toObject.?Quite simply,?toObject?returns the same representation as toJSON, only in a form of the actual object, without string serialization. For example, using the earlier example of a canvas with just a green rectangle, the output for?canvas.toObject?is as follows:

{ "background" : "rgba(0, 0, 0, 0)","objects" : [{"angle" : 0,"fill" : "green","flipX" : false,"flipY" : false,"hasBorders" : true,"hasControls" : true,"hasRotatingPoint" : false,"height" : 20,"left" : 50,"opacity" : 1,"overlayFill" : null,"perPixelTargetFind" : false,"scaleX" : 1,"scaleY" : 1,"selectable" : true,"stroke" : null,"strokeDashArray" : null,"strokeWidth" : 1,"top" : 50,"transparentCorners" : true,"type" : "rect","width" : 20}]}

As you can see, toJSON output is essentially stringified?toObject?output. Now, the interesting (and useful) thing is that?toObject?output is smart and lazy. What you see inside an “objects” array is the result of iterating over all canvas objects and delegating to each object’s own?toObject?method. For example,?fabric.Path?has its own?toObject?that knows to return path’s “points” array, and?fabric.Image?has a?toObject?that knows to return image’s “src” property. In true object-oriented fashion, all objects are capable of serializing themselves.

This means that when you create your own class, or simply need to customize an object’s serialized representation, all you need to do is work with the?toObjectmethod, either completely replacing it or extending it. Here’s an example:

var rect = new fabric.Rect();rect.toObject = function() {return { name: 'trololo' };};canvas.add(rect);console.log(JSON.stringify(canvas));

The logged output is:

'{"objects":[{"name":"trololo"}],"background":"rgba(0, 0, 0, 0)"}'

As you can see, the objects array now has a custom representation of our rectangle. This kind of override brings the point across but is probably not very useful. Instead, here’s how to extend a rectangle’s?toObject?method with an additional property:

var rect = new fabric.Rect();rect.toObject = (function(toObject) {return function() {return fabric.util.object.extend(toObject.call(this), {name: this.name});};})(rect.toObject);canvas.add(rect);rect.name = 'trololo';console.log(JSON.stringify(canvas));

And here’s the logged output:

'{"objects":[{"type":"rect","left":0,"top":0,"width":0,"height":0,"fill":"rgb(0,0,0)","overlayFill":null, "stroke":null,"strokeWidth":1,"strokeDashArray":null,"scaleX":1,"scaleY":1,"angle":0,"flipX":false, "flipY":false,"opacity":1,"selectable":true,"hasControls":true,"hasBorders":true,"hasRotatingPoint":false, "transparentCorners":true,"perPixelTargetFind":false,"rx":0,"ry":0,"name":"trololo"}], "background":"rgba(0, 0, 0, 0)"}'

I extended the object’s existing?toObject?method with the additional property “name”, which means that property is now part of the?toObject?output, and as a result it appears in the canvas JSON representation. One other item worth mentioning is that if you extend objects like this, you’ll also want to be sure the object’s “class” (fabric.Rect?in this case) has this property in the “stateProperties” array so that loading a canvas from a string representation will parse and add it to an object correctly.

toSVG

Another efficient text-based canvas representation is in SVG format. Since Fabric specializes in SVG parsing and rendering on canvas, it makes sense to make this a two-way process and provide canvas-to-SVG conversion. Let’s add the same rectangle to our canvas and see what kind of representation is returned from the?toSVGmethod:

canvas.add(new fabric.Rect({left: 50,top: 50,height: 20,width: 20,fill: 'green'}));console.log(canvas.toSVG());

The logged output is as follows:

'<?xml version="1.0" standalone="no" ?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="800" height="700" xml:space="preserve"><desc>Created with Fabric.js 0.9.21</desc><rect x="-10" y="-10" rx="0" ry="0" width="20" height="20" style="stroke: none; stroke-width: 1; stroke-dasharray: ; fill: green; opacity: 1;" transform="translate(50 50)" /></svg>'

Just like with?toJSON?and?toObject, the?toSVG?method—when called on canvas—delegates its logic to each individual object, and each individual object has its own?toSVG?method that is special to the type of object. If you ever need to modify or extend an SVG representation of an object, you can do the same thing with?toSVG?as I did earlier with?toObject.

The benefit of SVG representation, compared to Fabric’s proprietary?toObject/toJSON, is that you can throw it into any SVG-capable renderer (browser, application, printer, camera, and so on), and it should just work. With?toObject/toJSON, however, you first need to load it onto a canvas.

And speaking of loading things onto a canvas, now that you know how to serialize a canvas into an efficient chunk of text, how do you go about loading this data back onto canvas?

Deserialization and the SVG Parser

As with serialization, there’s two ways to load a canvas from a string: from JSON representation or from SVG. When using JSON representation, there are the?fabric.Canvas#loadFromJSON?and?fabric.Canvas#loadFromDatalessJSONmethods. When using SVG, there are?fabric.loadSVGFromURL?and?fabric.loadSVGFromString.

Notice that the first two methods are instance methods and are called on a canvas instance directly, whereas the other two methods are static methods and are called on the “fabric” object rather than on canvas.

There’s not much to say about most of these methods. They work exactly as you would expect them to. Let’s take as an example the previous JSON output from our canvas and load it on a clean canvas:

var?canvas?=?new?fabric.Canvas();canvas.loadFromJSON('{"objects":[{"type":"rect","left":50,"top":50,"width":20,"height":20, fill":"green","overlayFill":null,"stroke":null,"strokeWidth":1,"strokeDashArray":null,"scaleX":1, "scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"selectable":true,"hasControls":true, "hasBorders":true,"hasRotatingPoint":false,"transparentCorners":true,"perPixelTargetFind":false, "rx":0,"ry":0},"type":"circle","left":100,"top":100,"width":100,"height":100,"fill":"red", "overlayFill":null,"stroke":null,"strokeWidth":1,"strokeDashArray":null,"scaleX":1,"scaleY":1, "angle":0,"flipX":false,"flipY":false,"opacity":1,"selectable":true,"hasControls":true, "hasBorders":true,"hasRotatingPoint":false,"transparentCorners":true,"perPixelTargetFind":false, "radius":50}],"background":"rgba(0,?0,?0,?0)"}');

Both objects magically appear on canvas, as shown in?Figure 6.


Figure 6. A Circle and a Square Rendered on Canvas

So loading canvas from a string is pretty easy, but what about that strange-looking?loadFromDatalessJSON?method? How is it different from?loadFromJSON, which we just used? To understand why you need this method, look at a serialized canvas that has a more or less complex path object, like the one shown in?Figure 7.


Figure 7. A Complex Shape Rendered on Canvas

JSON.stringify(canvas) output for the shape in?Figure 7?is as follows:

{"objects":[{"type":"path","left":184,"top":177,"width":175,"height":151,"fill":"#231F20","overlayFill":null, "stroke":null,"strokeWidth":1,"strokeDashArray":null,"scaleX":1,"scaleY":1,"angle":-19,"flipX":false, "flipY":false,"opacity":1,"selectable":true,"hasControls":true,"hasBorders":true,"hasRotatingPoint":false, "transparentCorners":true,"perPixelTargetFind":false,"path":[["M",39.502,61.823],["c",-1.235,-0.902,-3.038, -3.605,-3.038,-3.605],["s",0.702,0.4,3.907,1.203],["c",3.205,0.8,7.444,-0.668,10.114,-1.97],["c",2.671,-1.302, 7.11,-1.436,9.448,-1.336],["c",2.336,0.101,4.707,0.602,4.373,2.036],["c",-0.334,1.437,-5.742,3.94,-5.742,3.94], ["s",0.4,0.334,1.236,0.334],["c",0.833,0,6.075,-1.403,6.542,-4.173],["s",-1.802,-8.377,-3.272,-9.013],["c",-1.468, -0.633,-4.172,0,-4.172,0],["c",4.039,1.438,4.941,6.176,4.941,6.176],["c",-2.604,-1.504,-9.279,-1.234,-12.619, 0.501],["c",-3.337,1.736,-8.379,2.67,-10.083,2.503],["c",-1.701,-0.167,-3.571,-1.036,-3.571,-1.036],["c",1.837, 0.034,3.239,-2.669,3.239,-2.669],["s",-2.068,2.269,-5.542,0.434],["c",-3.47,-1.837,-1.704,-8.18,-1.704,-8.18], ["s",-2.937,5.909,-1,9.816],["C",34.496,60.688,39.502,61.823,39.502,61.823],["z"],["M",77.002,40.772],["c",0,0, -1.78,-5.03,-2.804,-8.546],["l",-1.557,8.411],["l",1.646,1.602],["c",0,0,0,-0.622,-0.668,-1.691],["C",72.952, 39.48,76.513,40.371,77.002,40.772],["z"],["M",102.989,86.943],["M",102.396,86.424],["c",0.25,0.22,0.447,0.391, 0.594,0.519],["C",102.796,86.774,102.571,86.578,102.396,86.424],["z"],["M",169.407,119.374],["c",-0.09,-5.429, -3.917,-3.914,-3.917,-2.402],["c",0,0,-11.396,1.603,-13.086,-6.677],["c",0,0,3.56,-5.43,1.69,-12.461],["c", -0.575,-2.163,-1.691,-5.337,-3.637,-8.605],["c",11.104,2.121,21.701,-5.08,19.038,-15.519],["c",-3.34,-13.087, -19.63,-9.481,-24.437,-9.349],["c",-4.809,0.135,-13.486,-2.002,-8.011,-11.618],["c",5.473,-9.613,18.024,-5.874, 18.024,-5.874],["c",-2.136,0.668,-4.674,4.807,-4.674,4.807],["c",9.748,-6.811,22.301,4.541,22.301,4.541],["c", -3.097,-13.678,-23.153,-14.636,-30.041,-12.635],["c",-4.286,-0.377,-5.241,-3.391,-3.073,-6.637],["c",2.314, -3.473,10.503,-13.976,10.503,-13.976],["s",-2.048,2.046,-6.231,4.005],["c",-4.184,1.96,-6.321,-2.227,-4.362, -6.854],["c",1.96,-4.627,8.191,-16.559,8.191,-16.559],["c",-1.96,3.207,-24.571,31.247,-21.723,26.707],["c", 2.85,-4.541,5.253,-11.93,5.253,-11.93],["c",-2.849,6.943,-22.434,25.283,-30.713,34.274],["s",-5.786,19.583, -4.005,21.987],["c",0.43,0.58,0.601,0.972,0.62,1.232],["c",-4.868,-3.052,-3.884,-13.936,-0.264,-19.66],["c", 3.829,-6.053,18.427,-20.207,18.427,-20.207],["v",-1.336],["c",0,0,0.444,-1.513,-0.089,-0.444],["c",-0.535, 1.068,-3.65,1.245,-3.384,-0.889],["c",0.268,-2.137,-0.356,-8.549,-0.356,-8.549],["s",-1.157,5.789,-2.758, 5.61],["c",-1.603,-0.179,-2.493,-2.672,-2.405,-5.432],["c",0.089,-2.758,-1.157,-9.702,-1.157,-9.702],["c", -0.8,11.75,-8.277,8.011,-8.277,3.74],["c",0,-4.274,-4.541,-12.82,-4.541,-12.82],["s",2.403,14.421,-1.336, 14.421],["c",-3.737,0,-6.944,-5.074,-9.879,-9.882],["C",78.161,5.874,68.279,0,68.279,0],["c",13.428,16.088, 17.656,32.111,18.397,44.512],["c",-1.793,0.422,-2.908,2.224,-2.908,2.224],["c",0.356,-2.847,-0.624,-7.745, -1.245,-9.882],["c",-0.624,-2.137,-1.159,-9.168,-1.159,-9.168],["c",0,2.67,-0.979,5.253,-2.048,9.079],["c", -1.068,3.828,-0.801,6.054,-0.801,6.054],["c",-1.068,-2.227,-4.271,-2.137,-4.271,-2.137],["c",1.336,1.783, 0.177,2.493,0.177,2.493],["s",0,0,-1.424,-1.601],["c",-1.424,-1.603,-3.473,-0.981,-3.384,0.265],["c",0.089, 1.247,0,1.959,-2.849,1.959],["c",-2.846,0,-5.874,-3.47,-9.078,-3.116],["c",-3.206,0.356,-5.521,2.137,-5.698, 6.678],["c",-0.179,4.541,1.869,5.251,1.869,5.251],["c",-0.801,-0.443,-0.891,-1.067,-0.891,-3.473],...

…and that’s only 20 percent of the entire output!

What’s going on here? Well, it turns out that this?fabric.Path?instance—this shape—consists of literally hundreds of Bezier lines dictating how exactly it is to be rendered. All those [“c”,0,2.67,-0.979,5.253,-2.048,9.079] chunks in JSON representation correspond to each one of those curves. And when there’s hundreds (or even thousands) of them, the canvas representation ends up being quite enormous.

Situations like these are where?fabric.Canvas#toDatalessJSON?comes in handy. Let’s try it:

canvas.item(0).sourcePath?=?'/assets/dragon.svg';console.log(JSON.stringify(canvas.toDatalessJSON()));

Here’s the logged output:

{"objects":[{"type":"path","left":143,"top":143,"width":175,"height":151,"fill":"#231F20","overlayFill":null, "stroke":null,"strokeWidth":1,"strokeDashArray":null,"scaleX":1,"scaleY":1,"angle":-19,"flipX":false, "flipY":false,"opacity":1,"selectable":true,"hasControls":true,"hasBorders":true,"hasRotatingPoint":false, "transparentCorners":true,"perPixelTargetFind":false,"path":"/assets/dragon.svg"}],"background":"rgba(0, 0, 0, 0)"}

That’s certainly smaller, so what happened? Notice that before calling?toDatalessJSON, I gave the path (dragon shape) object a?sourcePath property of “/assets/dragon.svg”. Then, when I called?toDatalessJSON, the entire humongous path string from the previous output (those hundreds of path commands) is replaced with a single “dragon.svg” string.

When you’re working with lots of complex shapes,?toDatalessJSON?allows you to reduce canvas representation even further and replace huge path data representations with a simple link to SVG.

You can probably guess that the?loadFromDatalessJSON?method simply allows you to load a canvas from a data less version of a canvas representation. The?loadFromDatalessJSON?method pretty much knows how to take those “path” strings (like “/assets/dragon.svg”), load them, and use them as the data for corresponding path objects.

Now, let’s take a look at SVG-loading methods. We can use either string or URL. Let’s look at the string example first:

fabric.loadSVGFromString('...',?function(objects,?options)?{var?obj?=?fabric.util.groupSVGElements(objects,?options);canvas.add(obj).renderAll();});

The first argument is the SVG string, and the second is the callback function. The callback is invoked when SVG is parsed and loaded and receives two arguments—objects and options. The first, objects, contains an array of objects parsed from SVG—paths, path groups (for complex objects), images, text, and so on. To group those objects into a cohesive collection—and to make them look the way they do in an SVG document—we’re using?fabric.util.groupSVGElements and passing it both objects and options. In return, we get either an instance of?fabric.Path?or?fabric.PathGroup, which we can then add onto our canvas.

The?fabric.loadSVGFromURL?method works the same way, except that you pass a string containing a URL rather than SVG contents. Note that Fabric will attempt to fetch that URL via XMLHttpRequest, so the SVG needs to conform to the usual SOP rules.

Subclassing

Since Fabric is built in a truly object-oriented fashion, it’s designed to make subclassing and extension simple and natural. As described in the first article in this series, there’s an existing hierarchy of objects in Fabric. All two-dimensional objects (paths, images, text, and so on) inherit from?fabric.Object, and some “classes”—like?fabric.PathGroup?— even form a third-level inheritance.

So how do you go about subclassing one of the existing “classes” in Fabric, or maybe even creating a class of your own?

For this task you need the?fabric.util.createClass?utility method. This method is nothing but a simple abstraction over JavaScript’s prototypal inheritance. Let’s first create a simple Point “class”:

var Point = fabric.util.createClass({initialize: function(x, y) {this.x = x || 0;this.y = y || 0;},toString: function() {return this.x + '/' + this.y;}});

The?createClass?method takes an object and uses that object’s properties to create a class with instance-level properties. The only specially treated property is initialize, which is used as a constructor. Now, when initializing Point, we’ll create an instance with x and y properties and the?toString?method:

var?point?=?new?Point(10,?20);point.x;?//?10point.y;?//?20point.toString();?//?"10/20"

If we wanted to create a child of “Point” class—say a colored point—we would use?createClass?like so:

var ColoredPoint = fabric.util.createClass(Point, {initialize: function(x, y, color) {this.callSuper('initialize', x, y);this.color = color || '#000';},toString: function() {return this.callSuper('toString') + ' (color: ' + this.color + ')';}});

Notice how the object with instance-level properties is now passed as a second argument. And the first argument receives Point “class”, which tells?createClass?to use it as a parent class of this one. To avoid duplication, we’re using the?callSupermethod, which calls the method of a parent class. This means that if we were to change?Point, the changes would also propagate to the?ColoredPoint?class.

Here’s ColoredPoint in action:

var redPoint = new ColoredPoint(15, 33, '#f55');redPoint.x; // 15redPoint.y; // 33redPoint.color; // "#f55"redPoint.toString(); "15/35 (color: #f55)"

Now let’s see how to work with existing Fabric classes. For example, let’s create a?LabeledRect?class that will essentially be a rectangle that has some kind of label associated with it. When rendered on our canvas, that label will be represented as a text inside a rectangle (similar to the earlier group example with a circle and text). As you’re working with Fabric, you’ll notice that combined abstractions like this can be achieved either by using groups or by using custom classes.

var LabeledRect = fabric.util.createClass(fabric.Rect, {type: 'labeledRect',initialize: function(options) {options || (options = { });this.callSuper('initialize', options);this.set('label', options.label || '');},toObject: function() {return fabric.util.object.extend(this.callSuper('toObject'), {label: this.get('label')});},_render: function(ctx) {this.callSuper('_render', ctx);ctx.font = '20px Helvetica';ctx.fillStyle = '#333';ctx.fillText(this.label, -this.width/2, -this.height/2 + 20);}});

It looks like there’s quite a lot going on here, but it’s actually pretty simple. First, we’re specifying the parent class as?fabric.Rect, to utilize its rendering abilities. Next, we define the type property, setting it to “labeledRect“. This is just for consistency, because all Fabric objects have the type property (rect, circle, path, text, and so on.) Then there’s the already-familiar constructor (initialize), in which we utilize?callSuperonce again. Additionally, we set the object’s label to whichever value was passed via options. Finally, we’re left with two methods—toObject?and?_render. The?toObject method, as you already know from the serialization section, is responsible for object (and JSON) representation of an instance. Since?LabeledRect?has the same properties as regular?rect?but also a label, we’re extending the parent’s?toObjectmethod and simply adding a label into it. Last but not least, the?_render?method is what’s responsible for the actually drawing of an instance. There’s another?callSupercall in it, which is what renders rectangle, and an additional three lines of text-rendering logic.

If you were to render such object, you do something like the following.?Figure 8?shows the results.

var labeledRect = new LabeledRect({width: 100,height: 50,left: 100,top: 100,label: 'test',fill: '#faa'});canvas.add(labeledRect);


Figure 8. Rendering of labeledRect

Changing the label value or any of the other usual rectangle properties would obviously work as expected, as you can see here and in?Figure 9.

labeledRect.set({label: 'trololo',fill: '#aaf',rx: 10,ry: 10}


Figure 9. Modified labeledRect

Of course, at this point you’re free to modify the behavior of this class anyway you want. For example, you could make certain values the default values to avoid passing them every time to the constructor, or you could make certain configurable properties available on the instance. If you do make additional properties configurable, you might want to account for them in?toObject?and?initialize, as I’ve shown here:

...initialize: function(options) {options || (options = { });this.callSuper('initialize', options);// give all labeled rectangles fixed width/height of 100/50this.set({ width: 100, height: 50 });this.set('label', options.label || '');}..._render: function(ctx) {// make font and fill values of labels configurablectx.font = this.labelFont;ctx.fillStyle = this.labelFill;ctx.fillText(this.label, -this.width/2, -this.height/2 + 20);}...

Wrapping Up

That closes the third installment of this series, in which I’ve dived into some of the more advanced aspects of Fabric. With help from groups, serialization and deserialization and classes, you can take your app to a whole new level.

轉載于:https://www.cnblogs.com/oxspirt/p/9117089.html

總結

以上是生活随笔為你收集整理的fabricjs 高级篇(自定义类型)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

亚洲h在线播放在线观看h | 丁香综合激情 | 成人av电影免费在线播放 | 懂色av懂色av粉嫩av分享吧 | 激情五月婷婷综合 | 欧美成人xxx | 在线观看网站你懂的 | 成人在线视频论坛 | 8x8x在线观看视频 | 热re99久久精品国产66热 | 六月激情久久 | 日本中文乱码卡一卡二新区 | 欧美午夜久久 | 欧美精品乱码久久久久 | 亚洲国产日韩av | 亚洲精品456在线播放乱码 | 免费欧美高清视频 | 亚洲乱亚洲乱妇 | 久久久久亚洲国产精品 | 一区二区三区免费播放 | 超碰在线免费97 | 玖玖视频网 | 国产精品久久久久一区二区国产 | 久久精品一区二区国产 | 尤物九九久久国产精品的分类 | 国产资源 | 欧美激情视频一区二区三区 | 日韩一级电影网站 | 欧美精品成人在线 | 久二影院| 在线观看中文字幕一区二区 | 欧美亚洲三级 | 西西www444 | 中文字幕一区二区三区精华液 | 中文一区二区三区在线观看 | 一区 在线观看 | 久久久久久久久毛片精品 | 久草在线精品观看 | av官网| 一区在线观看视频 | 日日久视频 | 日韩欧美精品免费 | 久久久国产网站 | 91福利视频一区 | 久久日韩精品 | 国产精品一区专区欧美日韩 | 精品国产伦一区二区三区免费 | www.97视频| 九色视频网址 | 91成人免费 | www视频免费在线观看 | 亚洲国产美女久久久久 | 久久6精品 | 蜜臀av.com| 久久久国产在线视频 | 日韩免费av在线 | 日韩专区一区二区 | 亚洲国产福利视频 | 中文字幕在线视频国产 | 一级免费av| 天天干天天干天天色 | 天天射天天爱天天干 | 日韩国产精品久久久久久亚洲 | a√天堂中文在线 | 日本中文字幕在线看 | 欧美午夜性生活 | 亚洲欧美婷婷六月色综合 | 在线观看91av| 国产精品av在线免费观看 | 免费亚洲电影 | 四虎国产精品免费观看视频优播 | 国产一区二区免费 | 久久久高清免费视频 | 日韩欧美在线一区二区 | 精品女同一区二区三区在线观看 | 亚洲国产欧美一区二区三区丁香婷 | 欧美午夜精品久久久久久浪潮 | 国产一级做a | www.com黄| 91激情视频在线 | 激情黄色av | 性色av一区二区三区在线观看 | 99这里只有精品视频 | 99在线视频免费观看 | 最近免费中文字幕大全高清10 | 成人午夜黄色 | 玖玖爱免费视频 | 色网免费观看 | 日日摸日日爽 | 国产精品一区二区免费 | 日韩av一区二区在线 | 日韩欧美在线观看一区 | 国产成人精品福利 | 黄色最新网址 | 亚洲aaa毛片 | 麻豆久久| 激情偷乱人伦小说视频在线观看 | 国内小视频在线观看 | 在线亚州 | 亚洲精品网站在线 | 少妇bbr搡bbb搡bbb | 天天操狠狠操 | 狠狠色丁香婷婷综合基地 | 欧美亚洲成人免费 | 日韩欧美视频在线 | 婷婷狠狠操 | 又污又黄的网站 | 日韩毛片精品 | 久久婷婷色综合 | 国产精品成人一区二区三区 | 婷婷色 亚洲| 人人涩 | 天天色欧美 | 麻豆视频免费网站 | 欧美日韩在线免费观看视频 | 人人澡超碰碰 | 亚洲美女精品区人人人人 | 久久久影院一区二区三区 | 国产资源网| 欧美日韩网址 | 三三级黄色片之日韩 | 婷婷在线不卡 | 国产美女精品人人做人人爽 | 一级黄色片在线免费观看 | 99精品一区二区三区 | 久产久精国产品 | 一本一本久久a久久精品综合 | 亚洲激情影院 | 欧美成人h版在线观看 | 五月天婷亚洲天综合网鲁鲁鲁 | 日本韩国精品在线 | 亚洲天天摸日日摸天天欢 | 亚洲精品视频二区 | 9999激情 | 国产视频网站在线观看 | 色综合中文综合网 | 久久乱码卡一卡2卡三卡四 五月婷婷久 | 国产一区二区三区午夜 | 久久精品视频在线看 | 在线观看不卡视频 | 成人免费毛片aaaaaa片 | 天天·日日日干 | 91亚洲精品久久久蜜桃网站 | 久久激情五月婷婷 | 色爱区综合激月婷婷 | 一区二区三区日韩在线 | 色婷婷免费| 欧美亚洲久久 | 99精品视频播放 | 一区二区三区中文字幕在线观看 | 黄色成人在线观看 | 制服丝袜天堂 | www九九热| 日韩午夜电影 | 日韩18p| 亚洲成人黄色在线观看 | 在线观看亚洲成人 | 免费男女羞羞的视频网站中文字幕 | 日本在线观看一区二区三区 | 久久视屏网 | 日韩丝袜 | 丰满少妇一级 | 蜜臀aⅴ国产精品久久久国产 | 国产主播大尺度精品福利免费 | 精品国产乱码久久久久 | 一级成人网 | 精品国产一区二区久久 | 波多野结衣电影一区二区 | 亚色视频在线观看 | 久久成视频 | 国产精品久久一卡二卡 | 日韩av电影免费在线观看 | 亚洲精品午夜一区人人爽 | 中文字幕在线资源 | 国内精品中文字幕 | 亚洲在线看 | 狠狠色狠狠色合久久伊人 | 日韩综合第一页 | 欧美天天综合网 | a级国产乱理伦片在线播放 久久久久国产精品一区 | 开心丁香婷婷深爱五月 | av中文字幕在线观看网站 | 欧美巨大 | 日韩中文字幕视频在线 | 国产99久久99热这里精品5 | 久久人人爽人人 | 国产精品自产拍在线观看网站 | 99热这里只有精品免费 | 中文字幕在线观看资源 | 欧美日韩三级在线观看 | 中文字幕第一页在线视频 | 亚洲一区二区三区在线看 | 在线观看岛国片 | 久久久久久高潮国产精品视 | 成人一区二区三区在线 | 亚洲精品免费看 | 男女拍拍免费视频 | 久久激情小视频 | 日韩精品一区二区三区外面 | 久草久| 欧美精品一区在线 | 97超碰站 | 99久久一区| 国产一级免费片 | 日韩剧 | 91网在线观看 | 欧美亚洲另类在线视频 | 视频一区二区精品 | 超碰免费av | 欧美日韩视频网站 | 久久人人97超碰com | 久草在线资源免费 | 国产中文字幕视频在线观看 | 亚洲va韩国va欧美va精四季 | 欧美欧美| 久久99热这里只有精品国产 | 久久免费av| 久久久久久久久久久综合 | 久爱精品在线 | 精品无人国产偷自产在线 | 欧美特一级片 | 国产精品午夜久久久久久99热 | 亚洲视频资源在线 | 久久图 | 超碰成人网 | 久久国产亚洲视频 | 又湿又紧又大又爽a视频国产 | 波多野结衣日韩 | 黄a在线看 | 免费黄a | 久久国产一区二区三区 | 中文国产成人精品久久一 | 欧美一级黄色网 | 免费成人av在线看 | a√国产免费a | 欧美与欧洲交xxxx免费观看 | 国产精品99久久久精品 | 91精品一区国产高清在线gif | 香蕉影院在线播放 | 久久成人国产精品免费软件 | 国产三级在线播放 | 摸bbb搡bbb搡bbbb | 亚洲日本国产 | 久久久久久久久久免费 | 日韩在线观看网站 | 亚洲欧美日韩一区二区三区在线观看 | 国产亚洲精品久 | 久久婷婷国产色一区二区三区 | 成人午夜毛片 | 狠狠干我 | 亚洲欧洲成人精品av97 | 久久夜色精品国产亚洲aⅴ 91chinesexxx | 91精品国产成人www | 国产又粗又硬又爽视频 | 国产精品video爽爽爽爽 | 一区二区视 | 免费看三级网站 | 国产亚洲精品成人av久久影院 | 婷婷在线网 | 麻豆久久久久 | 久久久久久综合网天天 | 午夜av激情| 中文字幕精品www乱入免费视频 | 国产 日韩 欧美 中文 在线播放 | 国产精品a成v人在线播放 | 美女久久久久久久久久久 | 97视频免费看 | 国内精品久久久久影院优 | 操操操日日 | 久久精品久久久久久久 | 国产日韩欧美在线免费观看 | 亚洲丝袜中文 | 亚洲综合激情 | 成人午夜网 | 精品国产色 | 国产精品久久久久999 | 国产在线综合视频 | 成人影音av | 国产一区免费 | 国产中文字幕在线 | 免费国产在线观看 | 日本黄色免费在线 | 人人射人人射 | 亚洲天天综合网 | 国产小视频你懂的 | 国产欧美精品一区二区三区四区 | 激情综合亚洲 | 久精品视频在线观看 | 久久中文视频 | 蜜臀aⅴ国产精品久久久国产 | 欧美成年人在线视频 | 丁香网婷婷 | 人人网人人爽 | 久久天堂亚洲 | av黄色成人 | 国产精品九九视频 | 亚洲精品mv在线观看 | 91cn国产在线 | 最新av网址在线观看 | 黄色.com| 日韩成人精品一区二区三区 | 午夜美女网站 | 九九99 | 国产在线播放观看 | 亚洲欧洲国产视频 | 精品久久一| 中文字幕中文字幕在线中文字幕三区 | 日韩精品一区二区免费 | av青草| 中文字幕黄色网 | 国产精品18久久久久久vr | 最新国产在线视频 | 99久久夜色精品国产亚洲96 | 久久视频在线观看 | 日日干网 | 欧美黑人巨大xxxxx | 欧美大jb| 天天色综合天天 | 婷婷六月综合亚洲 | 深爱五月激情五月 | 99热最新在线 | 久久久久国产精品免费网站 | 欧美日韩3p | 在线有码中文 | 永久免费毛片 | 免费福利在线观看 | 四虎在线免费视频 | 91在线91 | 日韩视频中文字幕在线观看 | 成人h在线观看 | 日韩中文字幕在线看 | 国产96精品 | 国产精品理论片在线播放 | 午夜精品一区二区三区四区 | 亚洲一级电影在线观看 | 亚洲国产一区二区精品专区 | 91片网| 天天色天天干天天 | 成人黄色电影免费观看 | 黄色av电影 | 天躁狠狠躁| 亚洲精品观看 | 999视频网| 欧美性生活小视频 | 狠狠成人 | 精品1区2区3区 | 99精品免费视频 | 在线中文字幕电影 | 中文字幕综合在线 | 九九99靖品 | 久久久久久久久久电影 | 国产呻吟在线 | 国产专区日韩专区 | 国产精品视频大全 | 91资源在线视频 | 最新动作电影 | 激情婷婷在线 | 国产香蕉久久 | 色婷婷视频在线 | 婷婷丁香在线视频 | 久久成人精品电影 | 国产精品久久久久一区二区三区共 | 91在线免费视频观看 | 瑞典xxxx性hd极品 | 日韩免费一级电影 | a级国产乱理伦片在线播放 久久久久国产精品一区 | 日本精品视频在线播放 | 久久精品—区二区三区 | 国产色久 | 国产精品毛片一区二区在线 | 日本激情动作片免费看 | 免费黄色在线网址 | 91福利社在线观看 | 人人射人人射 | 精品视频 | 日韩簧片在线观看 | 中文字幕在线观看第二页 | 玖玖爱免费视频 | 亚洲精品mv在线观看 | 国产二区视频在线 | 日本精品va在线观看 | 久久美女免费视频 | 人人干天天干 | 一级免费黄视频 | 黄色网大全 | 精品久久久久亚洲 | 色a网 | 日韩簧片在线观看 | 久久综合九色综合网站 | 免费av的网站 | 国产一区视频在线播放 | 久久久高清 | 欧美性大战 | 精品免费观看视频 | 久久看看 | www久 | 国产91电影在线观看 | 丁香久久激情 | 久操97| 久久精品99国产国产精 | 亚洲人视频在线 | 99久久久久久国产精品 | 四虎成人免费观看 | 久久看毛片 | 成人h在线观看 | 91在线免费观看网站 | 亚州欧美精品 | 亚洲黄色一级电影 | 久久国产精品电影 | 国产精品美女www爽爽爽视频 | 久久少妇| 国产又粗又猛又黄又爽的视频 | 日韩精品视| 精品国产乱码久久久久久三级人 | 成人小视频在线观看免费 | 在线观看一区 | 日本精品xxxx | 日韩欧美精品一区二区三区经典 | 久久久午夜精品福利内容 | 97在线视| 成人wwwxxx视频 | 国产色视频一区二区三区qq号 | 久久久久国产精品免费网站 | 欧美孕交vivoestv另类 | 黄色成人av | 99久久www| 日韩欧美有码在线 | 精品亚洲一区二区三区 | 在线看v片成人 | aaaaaa毛片| 精品久久一 | 九九免费在线视频 | 天天综合91| 成人午夜黄色影院 | 高清视频一区 | 91最新视频 | 天堂在线v | 福利视频网址 | 99精品欧美一区二区三区黑人哦 | 在线观看欧美成人 | 麻豆一二| 人人舔人人 | 精品国精品自拍自在线 | 99精品国产99久久久久久福利 | 91福利视频免费观看 | 夜夜干天天操 | 在线免费黄色av | 亚洲乱码国产乱码精品天美传媒 | 欧美一区二区三区免费观看 | 欧美精品一二三 | 麻豆91精品视频 | 久久久免费毛片 | av在线一级 | 欧美a级片免费看 | 亚洲欧美日韩精品久久奇米一区 | 夜夜夜夜爽 | 黄网站大全 | 久久久久久高潮国产精品视 | 狠狠干综合网 | 最近中文国产在线视频 | 天天射天天操天天色 | 国产91亚洲精品 | 精品国产精品一区二区夜夜嗨 | 国产精品自产拍在线观看桃花 | 国产午夜一级毛片 | 久久99精品久久久久久久久久久久 | 五月天国产精品 | 久久精品国产精品 | 国产精品99蜜臀久久不卡二区 | 亚洲欧美日韩精品久久久 | 国产亚洲成人精品 | 成人在线免费av | 9999在线| 在线观看av不卡 | 欧美性另类| 久久观看最新视频 | 国产人免费人成免费视频 | 精品久久久久久久久久久久久 | 美女网站在线观看 | 国产黄色精品网站 | 国产精品理论片在线观看 | 欧美日韩aa| 国产中文 | 国产精品麻豆99久久久久久 | 久久6精品| 国精产品满18岁在线 | 四虎永久国产精品 | av免费电影网站 | 在线免费观看黄色小说 | 男女免费视频观看 | 国产精品美女 | 久久久久久美女 | 午夜国产在线观看 | 欧美一区二区三区在线播放 | 成人aaa毛片 | 久久午夜精品影院一区 | 中文字幕精品一区二区三区电影 | 亚洲国产高清在线观看视频 | 亚洲成熟女人毛片在线 | 欧美日韩精品区 | 91在线看片 | 91精品视频播放 | 激情综合啪 | 中文字幕在线观看一区 | 麻花传媒mv免费观看 | 亚洲国产午夜视频 | 国产高清视频在线 | 日本一区二区三区免费观看 | 天天久久夜夜 | 成人免费在线视频 | 日韩高清dvd | 国产馆在线播放 | 97国产电影| 欧美日韩三级 | 国产 视频 久久 | 成人午夜电影网 | 色网站在线| av在线播放一区二区三区 | 久久夜夜爽| 欧美日韩二区三区 | 91九色蝌蚪视频在线 | 日日激情 | 91日韩在线视频 | 91在线入口 | 日韩二区在线 | av在线之家电影网站 | 永久免费毛片在线观看 | 99免费在线观看视频 | 亚洲免费公开视频 | 亚洲精品一区二区在线观看 | 九九九九色 | 成人永久免费 | 亚洲精品视频在线观看视频 | 九色在线 | 波多野结衣在线中文字幕 | 少妇视频在线播放 | 波多野结衣电影一区二区三区 | a在线一区 | 色欲综合视频天天天 | 亚洲午夜久久久影院 | 久久精品国产一区二区三区 | 日韩久久精品一区二区三区下载 | 久久一线 | 天天天综合网 | 久久9999久久免费精品国产 | 日韩大陆欧美高清视频区 | 色在线国产 | 日韩国产精品久久 | 久久图 | 五月天婷婷在线观看视频 | 日韩在线二区 | 五月天视频网站 | 丁香色婷婷| 少妇资源站 | 91中文字幕网 | 视频一区二区免费 | 久久久国产一区二区三区四区小说 | 黄色影院在线观看 | 久久黄色免费 | 大荫蒂欧美视频另类xxxx | 日韩三级中文字幕 | 日韩高清在线一区二区 | 91av欧美 | 免费观看91| 天天操天天干天天插 | 天天爽天天碰狠狠添 | wwwav视频 | 一区二区视频在线播放 | 久草视频免费在线播放 | 99精品视频免费看 | 欧美成年性 | 六月天色婷婷 | 亚洲一二三在线 | 999久久久国产精品 高清av免费观看 | 人人澡人人模 | 亚洲最新视频在线播放 | 免费视频成人 | 九九热视频在线 | www色av| 久久视频在线观看免费 | 99精品欧美一区二区 | 日日夜夜天天综合 | 久草在线免费在线观看 | 国产精品麻 | 精品日本视频 | 亚洲欧美视频在线观看 | 国产小视频在线看 | 国色天香在线观看 | 色97在线 | 亚洲最新av网址 | 亚洲成人av片 | 久久国产精品99久久久久久丝袜 | 麻豆国产网站 | 99视频精品视频高清免费 | 91免费在线 | 91欧美国产 | 国产在线更新 | 成人在线视频一区 | 国产成人精品福利 | 免费黄色一区 | 国产精品久久久免费 | 波多野结衣资源 | 久久久国产精品视频 | 国产91对白在线播 | 国产成人av网址 | 国产精品一区二区三区久久久 | 91精品久久久久久综合乱菊 | 视频成人永久免费视频 | 97视频在线观看网址 | 久久国产电影院 | 人人插人人舔 | 日韩免费高清 | 精品一区二区av | 最新国产视频 | 久久99热这里只有精品 | 日韩精品久久久久久久电影竹菊 | 国产啊v在线观看 | 在线观看免费高清视频大全追剧 | 国产免费影院 | www.色国产| 91亚洲精品国偷拍 | 美女网站免费福利视频 | 奇米影视8888在线观看大全免费 | 911国产精品 | 精品久久久久亚洲 | 国产亚洲欧美在线视频 | 欧美一区在线看 | 二区视频在线 | 丁香高清视频在线看看 | 欧美日韩伦理在线 | 成人网在线免费视频 | 又黄又爽又色无遮挡免费 | 国产福利精品在线观看 | www.玖玖玖| 午夜精品一区二区三区可下载 | 日韩欧美在线观看一区二区三区 | 91av短视频 | 婷婷久久网 | 国产精品18久久久久久久 | 日本中文字幕在线电影 | 中文字幕在线观看免费高清完整版 | 91九色国产在线 | 成年人看片网站 | 久久精品—区二区三区 | 日本黄色大片儿 | 黄色免费大片 | 国产a高清| 在线成人看片 | 日日干影院 | 国产 一区二区三区 在线 | 国产精品日韩欧美 | 在线免费看片 | 精品一区二区三区四区在线 | 色婷婷久久 | 97超碰人人模人人人爽人人爱 | 97成人精品视频在线观看 | 日韩欧美大片免费观看 | 91精品国产欧美一区二区 | 精品久久久久久一区二区里番 | 久久se视频 | 麻豆综合网 | 天天插狠狠插 | 在线观看你懂的网址 | 久久精品一区二区三 | 91精品免费看 | 亚洲精品777 | 日韩精品免费在线观看视频 | 亚洲欧美日本国产 | 国产午夜精品av一区二区 | 婷婷六月久久 | 97狠狠干 | 色视频国产直接看 | 超碰在线免费97 | 在线观看国产 | 精品a级片| 中文av资源站 | 国产一级二级在线观看 | 国产视频久 | 91精品亚洲影视在线观看 | 91精品网站 | 欧美午夜精品久久久久久孕妇 | 天天综合网在线观看 | 97综合网| 亚洲日本一区二区在线 | 天天看天天干天天操 | 伊人天天综合 | 久久精品久久精品久久精品 | 国产成人一二片 | 国产黄网在线 | 亚洲午夜久久久久久久久久久 | 五月婷婷综| 午夜视频久久久 | 99国产高清| 久久免费视频网 | 欧美精品在线一区二区 | 国产一级在线观看视频 | 国产精品久久久 | 成人av免费网站 | 亚洲成人精品久久 | www.亚洲精品在线 | 婷婷激情网站 | 国产1区2区3区在线 亚洲自拍偷拍色图 | 激情开心| 免费高清在线观看成人 | 久草精品在线观看 | 久操伊人| 五月天婷婷狠狠 | 99亚洲精品视频 | 在线观看你懂的网站 | 亚洲视频一区二区三区在线观看 | 天天干天天爽 | 午夜精品电影一区二区在线 | 国产日韩精品一区二区三区 | www.综合网.com | 国产综合片 | 91日韩国产| 国产精品综合久久久久久 | 91精品办公室少妇高潮对白 | 国产精品一区二区电影 | 国产精品毛片完整版 | 久久成人久久 | 在线免费高清视频 | 欧美另类网站 | 黄色精品久久久 | 久久99久久99 | 黄在线免费观看 | 亚州国产视频 | 久保带人 | 欧美一级片播放 | 麻豆传媒视频观看 | 深爱激情站 | 五月宗合网 | 国产又粗又猛又爽又黄的视频先 | 高清久久久 | 国产视频精品视频 | 韩日在线一区 | 久久久久久久久久影视 | 毛片激情永久免费 | japanese黑人亚洲人4k | 国产一区二区在线影院 | 久草电影在线观看 | 69国产精品视频 | 亚洲国产欧美在线看片xxoo | 日av免费 | 美女视频a美女大全免费下载蜜臀 | 成人在线视频免费观看 | 久久成人精品视频 | 综合伊人av | 六月激情丁香 | 日韩理论在线视频 | 久久成人资源 | 久久国内精品 | 手机在线免费av | 又湿又紧又大又爽a视频国产 | 欧美日韩国产三级 | www中文在线 | 亚洲精品视频免费在线观看 | 9免费视频 | 精品亚洲免费 | 久久久国产网站 | 青青草在久久免费久久免费 | www.亚洲精品 | 午夜精品视频福利 | 成人一级片视频 | 国产成人久久久77777 | 日韩精品一区二区三区丰满 | 中文字幕在线观看av | 国产超碰97 | 1024手机看片国产 | 国产在线观看av | 成人av在线资源 | 久久综合色影院 | 久久精品黄 | 亚洲精品视频网址 | 在线视频久久 | 在线视频精品播放 | 波多野结衣一区二区三区中文字幕 | 国产四虎影院 | 国产99久久久久久免费看 | 制服丝袜欧美 | 综合久久久久久久久 | 国产高清视频在线 | 97精品视频在线播放 | 免费国产在线精品 | 久久免费在线观看视频 | 久久久免费在线观看 | 国产中文视 | 99久久婷婷国产综合精品 | 狠狠干五月天 | 免费看的黄网站软件 | 日韩欧美电影在线观看 | 国产免费嫩草影院 | 在线视频一二三 | 久久久精品视频网站 | 五月天婷婷丁香花 | 午夜婷婷在线观看 | 亚洲欧美日韩中文在线 | 午夜在线免费视频 | 成 人 黄 色 片 在线播放 | 狠狠狠狠狠色综合 | 菠萝菠萝蜜在线播放 | 久久久精品免费观看 | 久草在线久草在线2 | 肉色欧美久久久久久久免费看 | 麻豆免费视频观看 | 美女网站免费福利视频 | 亚洲美女在线国产 | 亚洲九九九在线观看 | 久久精品爱爱视频 | 日日弄天天弄美女bbbb | 精品国产123 | 99久久久久成人国产免费 | 美女视频黄网站 | av色影院 | 高清av在线 | 伊人黄 | 99热免费在线 | 在线国产激情视频 | 96超碰在线 | 在线播放国产一区二区三区 | 久久久久成| 久久手机精品视频 | 三级黄色在线观看 | 亚洲 欧美日韩 国产 中文 | 亚洲精欧美一区二区精品 | 婷婷色在线 | 国产97在线播放 | 色综合天天色综合 | 日本女人的性生活视频 | 亚州中文av | 在线 国产一区 | 九九九九热精品免费视频点播观看 | а天堂中文最新一区二区三区 | 婷婷六月激情 | 精品一区二区6 | 福利视频在线看 | 麻花豆传媒mv在线观看网站 | 玖玖在线看 | 国产一区二区三区 在线 | 国产成人精品不卡 | 国产 在线 日韩 | 久久久精品小视频 | 97电影院在线观看 | 久草在线91| 丁香婷婷综合激情五月色 | 精品久久久久久综合 | 伊人中文在线 | 五月视频 | 亚洲精选99 | 国产成人av综合色 | 婷婷福利影院 | 国产在线欧美日韩 | 中文日韩在线视频 | 成人 国产 在线 | 国产尤物视频在线 | 亚洲作爱 | 中文字幕资源在线 | 午夜精品视频在线 | 99精品毛片 | 国产一区福利 | 日韩专区一区二区 | 最近日本韩国中文字幕 | 日韩av电影免费在线观看 | 在线观看91精品视频 | 中文av日韩| 国产福利91精品一区二区三区 | 久久国产精品第一页 | 色瓜 | 91禁在线看 | 黄av资源 | 久久国产精品免费一区二区三区 | 久久国产午夜精品理论片最新版本 | 特级毛片在线 | 黄色成年网站 | 国产精品免费观看在线 | 国产精品一区二区在线免费观看 | 午夜精品久久久久久久99水蜜桃 | 国产品久精国精产拍 | 在线亚洲午夜片av大片 | 天堂资源在线观看视频 | 国内精品久久久久久久久久久久 | 亚洲成人精品在线观看 | 黄p网站在线观看 | 日韩电影在线观看一区二区 | 在线免费日韩 | 五月婷婷导航 | www.五月婷婷 | 奇米影视777四色米奇影院 | 最近中文字幕在线中文高清版 | 国产传媒中文字幕 | 中文字幕免费观看视频 | a在线观看国产 | 在线观看小视频 | 女人高潮一级片 | 日韩高清不卡在线 | 国产麻豆精品久久一二三 | 激情婷婷久久 | 日本性生活一级片 | 99久久综合狠狠综合久久 | 97超碰在线免费观看 | 丁香婷五月 | 在线免费观看视频一区 | 国产精品亚 | 综合久久婷婷 | 成人午夜精品福利免费 | 一区二区 精品 | 99免费看片 | 午夜婷婷网 | 国产精品一区二区 91 | 波多野结衣综合网 | 日日夜夜精品免费 | 亚洲精品日韩一区二区电影 | 欧美日韩国产二区三区 | 一级黄色片在线 | 久久久久一区二区三区 | 日韩国产欧美在线播放 | 亚洲精品久久久久中文字幕二区 | 亚洲女人天堂成人av在线 | 日本精品久久久久影院 | 一区二区免费不卡在线 | 日韩黄色在线电影 | 欧美一二三区在线播放 | 欧美日韩天堂 | 五月天久久久久久 | 国产二区电影 | 91精品看片| 蜜臀av性久久久久蜜臀aⅴ涩爱 | 国产色拍拍拍拍在线精品 | 制服丝袜亚洲 | 最新色视频 | 天天操天天操天天操天天操 | 国产主播大尺度精品福利免费 | 激情综合五月婷婷 | 美女网站黄在线观看 | avove黑丝| 97天堂网 | 久久国产欧美日韩精品 | 在线观看aa | 伊人宗合网 | 天天射天天爽 | 在线国产精品视频 | 亚洲免费小视频 | 欧美福利久久 | 99在线观看视频 | 婷婷丁香花五月天 | 成人国产精品一区 | 97视频一区 | 九草在线观看 | 欧美一区二视频在线免费观看 | 中文字幕乱码在线播放 | 亚洲精品动漫久久久久 | 天堂素人在线 | 四虎国产免费 | 91精品国产欧美一区二区成人 | 国产亚洲免费的视频看 | 有码中文字幕 | 成年人免费观看国产 | 欧美精品久久久久久久久久白贞 | 夜色资源站国产www在线视频 | 日本久久视频 | 亚洲精品乱码白浆高清久久久久久 | 在线97| 天天在线免费视频 | 婷婷黄色片 | 天天操天天舔天天爽 | 97综合视频 | 激情黄色一级片 | 97高清视频 | 国产精品一区二区免费视频 | www日韩精品 | 黄色精品一区二区 | 色多多污污 | 亚洲成人精品 | 欧美色图88 | 黄色网址国产 | 婷婷5月激情5月 | 日韩最新在线视频 | 日韩精品视频在线观看免费 | 9999在线视频 | 国产女人免费看a级丨片 | 欧美日韩a视频 | 人人爱人人舔 | 久久av网址 | 九九热久久免费视频 | 久久精品专区 | 一区二区三区日韩精品 | 麻豆视频观看 | 探花视频在线观看 | 久久精品日本啪啪涩涩 | 精品一区 精品二区 | 成年人天堂com | 亚洲欧洲精品一区 | 中文字幕av在线不卡 | 色婷婷激情 | 91看片在线免费观看 | 国产午夜一区二区 | 欧美一区二区三区在线视频观看 | 在线观看国产一区二区 |