2486 xOfCol:col inVisibleLine:visLineNr |
2486 xOfCol:col inVisibleLine:visLineNr |
2487 "given a visible line- and colNr, return x-coordinate in view" |
2487 "given a visible line- and colNr, return x-coordinate in view" |
2488 |
2488 |
2489 |line lineSize tcol| |
2489 |line lineSize tcol| |
2490 |
2490 |
|
2491 col == 1 ifTrue:[^ textStartLeft]. |
2491 tcol := col - 1. |
2492 tcol := col - 1. |
|
2493 |
2492 line := self visibleAt:visLineNr. |
2494 line := self visibleAt:visLineNr. |
2493 (fontIsFixedWidth |
2495 (fontIsFixedWidth |
2494 and:[line isNil |
2496 and:[line isNil |
2495 or:[line isMemberOf:String]]) ifTrue:[ |
2497 or:[line isMemberOf:String]]) ifTrue:[ |
2496 ^ (tcol * fontWidth) + textStartLeft |
2498 ^ (tcol * fontWidth) + textStartLeft |
2497 ]. |
2499 ]. |
2498 line notNil ifTrue:[ |
2500 line notNil ifTrue:[ |
2499 lineSize := line size |
2501 lineSize := line size |
2500 ] ifFalse:[ |
2502 ] ifFalse:[ |
2501 lineSize := 0 |
2503 lineSize := 0 |
2502 ]. |
2504 ]. |
2503 (lineSize == 0) ifTrue:[ |
2505 (lineSize == 0) ifTrue:[ |
2504 ^ (tcol * fontWidth) + textStartLeft |
2506 ^ (tcol * fontWidth) + textStartLeft |
2505 ]. |
2507 ]. |
2506 |
2508 |
2507 (lineSize < col) ifTrue:[ |
2509 (lineSize < col) ifTrue:[ |
2508 ^ (line widthOn:self) |
2510 ^ (line widthOn:self) |
2509 + (fontWidth * (tcol - lineSize)) |
2511 + (fontWidth * (tcol - lineSize)) |
2510 + textStartLeft |
2512 + textStartLeft |
2511 ]. |
2513 ]. |
2512 (line isMemberOf:String) ifTrue:[ |
2514 (line isMemberOf:String) ifTrue:[ |
2513 ^ (font widthOf:line from:1 to:tcol) + textStartLeft |
2515 ^ (font widthOf:line from:1 to:tcol) + textStartLeft |
2514 ]. |
2516 ]. |
2515 ^ ((line copyTo:tcol) widthOn:self) + textStartLeft |
2517 ^ ((line copyTo:tcol) widthOn:self) + textStartLeft |
2516 |
2518 |
2517 "Modified: / 3.9.1998 / 21:56:33 / cg" |
2519 "Modified: / 3.9.1998 / 21:56:33 / cg" |
2518 ! |
2520 ! |