code-surfer icon indicating copy to clipboard operation
code-surfer copied to clipboard

Allow to specify zoom level on a per-step basis

Open vlsi opened this issue 5 years ago • 0 comments

It is great that Code Surfer can figure out the proper zoom level so the contents fits to the screen, however it does not work great when CodeSurfer instances are located on different slides (e.g. with different highlight language).

It would be great if there was a way to specify minZoom and/or maxZoom so different CodeSurfer instances could look alike.

This looks like https://github.com/pomber/code-surfer/issues/97, however, columns should probably negotiate the font size automatically (e.g. select the minimum between the columns), while this issue is more on "manually aligning font size across different slides".

Sample. Note: CodeSurfer can't switch between languages across steps, and it can't "add a single - sign to a line" yet, so I use different slides which results in layout jumps.

<CodeSurfer>

```java
@Test
public void now_ZoneId__uses_system_time() {
    ZoneId zone = ZoneId.of("UTC+01:02:03");
    LocalDateTime expected = LocalDateTime.now(Clock.system(zone));
    LocalDateTime test = LocalDateTime.now(zone);
    assertEquals(
      test.truncatedTo(ChronoUnit.SECONDS),
      expected.truncatedTo(ChronoUnit.SECONDS),
      "now(ZoneId)==$expected should be similar to now(Clock)==$test"
    );
}
```

</CodeSurfer>

---

<CodeSurfer>

```diff
@Test
public void now_ZoneId__uses_system_time() {
    ZoneId zone = ZoneId.of("UTC+01:02:03");
    LocalDateTime expected = LocalDateTime.now(Clock.system(zone));
    LocalDateTime test = LocalDateTime.now(zone);
    assertEquals(
      test.truncatedTo(ChronoUnit.SECONDS),
      expected.truncatedTo(ChronoUnit.SECONDS),
-      "now(ZoneId)==$expected should be similar to now(Clock)==$test"
    );
}
```

</CodeSurfer>

vlsi avatar Jul 01 '20 08:07 vlsi