Skip to content

Allow to specify zoom level on a per-step basis #99

@vlsi

Description

@vlsi

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 #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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions