Commit 625ec857 authored by Li MingZhe's avatar Li MingZhe

fix: 字体居中

parent 4e90e91d
No preview for this file type
<div class="position-relative">
<div class="position-relative" style="display: flex;">
<nz-upload class="p-image-uploader" [nzDisabled]="disableUpload"
[nzShowUploadList]="false"
nzAccept = "image/*"
......@@ -28,10 +28,15 @@
</div>
</div>
</nz-upload>
<div class="p-btn-delete" *ngIf="canDelete"
<!-- <button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button> -->
<button nz-button
nzType="danger"
*ngIf="canDelete"
nz-popconfirm nzTitle="Are you sure ?"
(nzOnConfirm)="onDelete()"
>
<i nz-icon nzType="close" nzTheme="outline"></i>
</div>
</button>
</div>
......@@ -13,7 +13,7 @@ export class UploadImageWithPreviewComponent implements OnDestroy, OnChanges {
@Input()
picUrl;
@Input()
canDelete = false;
canDelete = true;
@Output()
imageUploaded = new EventEmitter();
@Output()
......@@ -88,7 +88,9 @@ export class UploadImageWithPreviewComponent implements OnDestroy, OnChanges {
}
onDelete() {
this.delete.emit();
// this.delete.emit();
this.imageUploaded.emit({});
}
checkSelectFile(file) {
const isImg = ['image/jpeg', 'image/png', 'image/jpeg', 'image/gif', 'image/bmp'].includes(file.type);
......@@ -120,6 +122,7 @@ export class UploadImageWithPreviewComponent implements OnDestroy, OnChanges {
file['height'] = height;
file['width'] = width;
img.remove();
this.imageUploaded.emit(file.response);
// this.resService.updateImage(id, {width, height}).then( () => {
// this.imageUploaded.emit({res_id: id, id, name, hash, url});
......
......@@ -864,6 +864,8 @@ cc.Class({
let px, py = 0;
let isChangeLine = false;
let line = 0;
let lineArr = [[], []];
for (let i=0; i<answerArr.length; i++) {
const opData = answerArr[i];
const wordGroup = this.getWordGroup(opData, false, false);
......@@ -883,6 +885,7 @@ cc.Class({
answerNode.width = 0;
px = wordGroup.width / 2 * wordGroup.scale;
py -= 100;
line += 1;
}
}
......@@ -895,6 +898,8 @@ cc.Class({
answerNode.addChild(wordGroup)
childArr.push(wordGroup);
lineArr[line].push(wordGroup);
}
......@@ -915,6 +920,23 @@ cc.Class({
this.answerGroupArr = childArr;
const line1 = lineArr[0];
const line1LastItem = line1[line1.length - 1];
const totalLine1 = line1LastItem.x + line1LastItem.width / 2;
const offX1 = (maxW - totalLine1) / 2
for (let i=0; i<line1.length; i++) {
line1[i].x += offX1;
}
const line2 = lineArr[1];
const line2LastItem = line2[line2.length - 1];
const totalLine2 = line2LastItem.x + line2LastItem.width / 2;
const offX2 = (maxW - totalLine2) / 2
for (let i=0; i<line2.length; i++) {
line2[i].x += offX2;
}
// 拖拽异常 转一下坐标
for (let i=0; i<childArr.length; i++) {
const wordNode = childArr[i];
......
No preview for this file type
{"ios":{"sceneName":"dfzx_cocos_pinjuzi","version":"96be0"},"android":{"sceneName":"dfzx_cocos_pinjuzi","version":"96be0"}}
\ No newline at end of file
{"ios":{"sceneName":"dfzx_cocos_pinjuzi","version":"45344"},"android":{"sceneName":"dfzx_cocos_pinjuzi","version":"45344"}}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment