Commit 7f093726 authored by liujiaxin's avatar liujiaxin

scale text

parent 43d814f2
......@@ -35,7 +35,7 @@ export class ScaleTextDirective implements AfterViewInit {
word-spacing: normal;
word-break: keep-all;
white-space: nowrap;
margin-left: ${this.offsetX}px
margin-left: 8px;
`;
const span = document.createElement('span');
span.innerHTML = `${this.Element.nativeElement.textContent}`;
......@@ -43,7 +43,7 @@ export class ScaleTextDirective implements AfterViewInit {
this.Element.nativeElement.childNodes.forEach(n => n.remove());
this.Element.nativeElement.append(span);
setTimeout(() => {
const fitWidth = this.Element.nativeElement.offsetWidth - this.offsetX;
const fitWidth = this.Element.nativeElement.offsetWidth - 8;
const textWidth = span.offsetWidth;
console.log(textWidth, fitWidth);
if (textWidth > fitWidth) {
......
......@@ -610,8 +610,10 @@ img.c-icon {right: 0px; top: 4px; position: absolute; width: 36px;}
}
.q-qo{
overflow: hidden;
width: 100%;
width: calc(100% - 42px);
height: 100%;
text-indent: -42px;
padding-left: 42px;
/*padding-left: 42px;*/
position: absolute;
left: 42px;
}
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