Skip to content

Commit

Permalink
feat: FFVideo add initScale
Browse files Browse the repository at this point in the history
  • Loading branch information
drawcall committed Sep 6, 2021
1 parent c330f84 commit c4d7609
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions lib/node/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class FFVideo extends FFImage {
* @private
*/
createDisplay() {
const { width = 300, height = 200 } = this.conf;
const [width, height] = this.getWH();
this.display = new Sprite();
this.display.attr({ width, height });
this.setAnchor(0.5);
Expand Down Expand Up @@ -223,13 +223,15 @@ class FFVideo extends FFImage {
* @private
*/
drawCoverImage() {
const { display } = this;
const [width, height] = this.getWH();
const frame = this.materials.getSourceRect(width, height);
// const orig = new Rectangle(0, 0, width, height);
// const trim = new Rectangle(0, 0, width, height);
const texture = new Texture(new BaseTexture(), frame);
this.display.texture = texture;
this.display.attr({ width, height });

display.texture = texture;
display.attr({ width, height });
display.initScale && display.initScale.copy(display.scale);

this.drawing();
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffcreator",
"version": "4.5.2",
"version": "4.5.5",
"description": "FFCreator is a lightweight and flexible short video production library",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit c4d7609

Please sign in to comment.